current_time

Definition:
function current_time( $type, $gmt = 0 ) {}

Retrieve the current time based on specified type.
The ‘mysql’ type will return the time in the format for MySQL DATETIME field. The ‘timestamp’ type will return the current timestamp.

Parameters

  • string $type: Either ‘mysql’ or ‘timestamp’.
  • int|bool $gmt: Optional. Whether to use GMT timezone. Default is false.

Return values

returns:String if $type is ‘gmt’, int if $type is ‘timestamp’.

Source code

function current_time( $type, $gmt = 0 ) {

	switch ( $type ) {

		case 'mysql':

			return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * 3600 ) ) );

			break;

		case 'timestamp':

			return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * 3600 );

			break;

	}

}

754

current_theme_supports

Definition:
function current_theme_supports( $feature ) {}

Checks a theme’s support for a given feature

Parameters

  • string $feature: the feature being checked

Source code

function current_theme_supports( $feature ) {

	global $_wp_theme_features;



	if ( !isset( $_wp_theme_features[$feature] ) )

		return false;



	// If no args passed then no extra checks need be performed

	if ( func_num_args() <= 1 )

		return true;



	$args = array_slice( func_get_args(), 1 );



	// @todo Allow pluggable arg checking

	switch ( $feature ) {

		case 'post-thumbnails':

			// post-thumbnails can be registered for only certain content/post types by passing

			// an array of types to add_theme_support().  If no array was passed, then

			// any type is accepted

			if ( true === $_wp_theme_features[$feature] )  // Registered for all types

				return true;

			$content_type = $args[0];

			return in_array( $content_type, $_wp_theme_features[$feature][0] );

			break;



		case 'post-formats':

			// specific post formats can be registered by passing an array of types to

			// add_theme_support()

			$post_format = $args[0];

			return in_array( $post_format, $_wp_theme_features[$feature][0] );

			break;

	}



	return true;

}

752

current_theme_info

Definition:
function current_theme_info() {}

Source code

function current_theme_info() {

	$themes = get_themes();

	$current_theme = get_current_theme();

	if ( ! isset( $themes[$current_theme] ) ) {

		delete_option( 'current_theme' );

		$current_theme = get_current_theme();

	}

	$ct->name = $current_theme;

	$ct->title = $themes[$current_theme]['Title'];

	$ct->version = $themes[$current_theme]['Version'];

	$ct->parent_theme = $themes[$current_theme]['Parent Theme'];

	$ct->template_dir = $themes[$current_theme]['Template Dir'];

	$ct->stylesheet_dir = $themes[$current_theme]['Stylesheet Dir'];

	$ct->template = $themes[$current_theme]['Template'];

	$ct->stylesheet = $themes[$current_theme]['Stylesheet'];

	$ct->screenshot = $themes[$current_theme]['Screenshot'];

	$ct->description = $themes[$current_theme]['Description'];

	$ct->author = $themes[$current_theme]['Author'];

	$ct->tags = $themes[$current_theme]['Tags'];

	$ct->theme_root = $themes[$current_theme]['Theme Root'];

	$ct->theme_root_uri = $themes[$current_theme]['Theme Root URI'];

	return $ct;

}

750

current_filter

Definition:
function current_filter() {}

Retrieve the name of the current filter or action.

Return values

returns:Hook name of the current filter or action.

Source code

function current_filter() {

	global $wp_current_filter;

	return end( $wp_current_filter );

}

748

create_user

Definition:
function create_user($username, $password, $email) {}

An alias of wp_create_user().

Parameters

  • string $username: The user’s username.
  • string $password: The user’s password.
  • string $email: The user’s email (optional).

Return values

returns:The new user’s ID.

Source code

function create_user($username, $password, $email) {

	_deprecated_function( __FUNCTION__, '2.0', 'wp_create_user()' );

	return wp_create_user($username, $password, $email);

}

746