get_date_from_gmt

Definition:
function get_date_from_gmt($string, $format = 'Y-m-d H:i:s') {}

Converts a GMT date into the correct format for the blog.
Requires and returns in the Y-m-d H:i:s format. Simply adds the value of gmt_offset.Return format can be overridden using the $format parameter

Parameters

  • string $string: The date to be converted.
  • string $format: The format string for the returned date (default is Y-m-d H:i:s)

Return values

returns:Formatted date relative to the GMT offset.

Source code

function get_date_from_gmt($string, $format = 'Y-m-d H:i:s') {

	preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches);

	$string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);

	$string_localtime = gmdate($format, $string_time + get_option('gmt_offset')*3600);

	return $string_localtime;

}

1350

get_dashboard_blog

Definition:
function get_dashboard_blog() {}

Get the "dashboard blog", the blog where users without a blog edit their profile data.

Source code

function get_dashboard_blog() {

	if ( $blog = get_site_option( 'dashboard_blog' ) )

		return get_blog_details( $blog );



	return get_blog_details( $GLOBALS['current_site']->blog_id );

}

1348

get_current_user_id

Definition:
function get_current_user_id() {}

Get the current user’s ID

Return values

returns:The current user’s ID

Source code

function get_current_user_id() {

	$user = wp_get_current_user();

	return ( isset( $user->ID ) ? (int) $user->ID : 0 );

}

1346

get_current_theme

Definition:
function get_current_theme() {}

Retrieve current theme display name.
If the ‘current_theme’ option has already been set, then it will be returned instead. If it is not set, then each theme will be iterated over until both the current stylesheet and current template name.

Source code

function get_current_theme() {

	if ( $theme = get_option('current_theme') )

		return $theme;



	$themes = get_themes();

	$current_theme = 'Twenty Eleven';



	if ( $themes ) {

		$theme_names = array_keys( $themes );

		$current_template = get_option( 'template' );

		$current_stylesheet = get_option( 'stylesheet' );



		foreach ( (array) $theme_names as $theme_name ) {

			if ( $themes[$theme_name]['Stylesheet'] == $current_stylesheet &&

					$themes[$theme_name]['Template'] == $current_template ) {

				$current_theme = $themes[$theme_name]['Name'];

				break;

			}

		}

	}



	update_option('current_theme', $current_theme);



	return $current_theme;

}

1344

get_current_site

Definition:
function get_current_site() {}

Get the current site info.
Returns an object containing the ID, domain, path, and site_name of the site being viewed.

Source code

function get_current_site() {

	global $current_site;

	return $current_site;

}

1342