get_id_from_blogname

Definition:
function get_id_from_blogname( $name ) {}

Given a blog’s (subdomain or directory) name, retrieve it’s id.

Parameters

  • string $name

Return values

returns:A blog id

Source code

function get_id_from_blogname( $name ) {

	global $wpdb, $current_site;

	$blog_id = wp_cache_get( 'get_id_from_blogname_' . $name, 'blog-details' );

	if ( $blog_id )

		return $blog_id;



	if ( is_subdomain_install() ) {

		$domain = $name . '.' . $current_site->domain;

		$path = $current_site->path;

	} else {

		$domain = $current_site->domain;

		$path = $current_site->path . $name . '/';

	}

	$blog_id = $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM {$wpdb->blogs} WHERE domain = %s AND path = %s", $domain, $path) );

1420

get_home_url

Definition:
function get_home_url( $blog_id = null, $path = '', $scheme = null ) {}

Retrieve the home url for a given site.
Returns the ‘home’ option with the appropriate protocol, ‘https’ if is_ssl() and ‘http’ otherwise. If $scheme is ‘http’ or ‘https’, is_ssl() is overridden.

Parameters

  • int $blog_id: (optional) Blog ID. Defaults to current blog.
  • string $path: (optional) Path relative to the home url.
  • string $scheme: (optional) Scheme to give the home url context. Currently ‘http’, ‘https’.

Return values

returns:Home url link with optional path appended.

Defined filters

  • home_url
    apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id )

Source code

function get_home_url( $blog_id = null, $path = '', $scheme = null ) {

	$orig_scheme = $scheme;



	if ( !in_array( $scheme, array( 'http', 'https' ) ) )

		$scheme = is_ssl() && !is_admin() ? 'https' : 'http';



	if ( empty( $blog_id ) || !is_multisite() )

		$url = get_option( 'home' );

	else

		$url = get_blog_option( $blog_id, 'home' );



	if ( 'http' != $scheme )

		$url = str_replace( 'http://', "$scheme://", $url );



	if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )

		$url .= '/' . ltrim( $path, '/' );



	return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );

}

1418

get_home_template

Definition:
function get_home_template() {}

Retrieve path of home template in current or parent template.
This is the template used for the page containing the blog posts

Source code

function get_home_template() {

	$templates = array( 'home.php', 'index.php' );



	return get_query_template( 'home', $templates );

}

1416

get_home_path

Definition:
function get_home_path() {}

Get the absolute filesystem path to the root of the WordPress installation

Return values

returns:Full filesystem path to the root of the WordPress installation

Source code

function get_home_path() {

	$home = get_option( 'home' );

	$siteurl = get_option( 'siteurl' );

	if ( $home != '' && $home != $siteurl ) {

		$wp_path_rel_to_home = str_replace($home, '', $siteurl); /* $siteurl - $home */

		$pos = strpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home);

		$home_path = substr($_SERVER["SCRIPT_FILENAME"], 0, $pos);

		$home_path = trailingslashit( $home_path );

	} else {

		$home_path = ABSPATH;

	}



	return $home_path;

}

1414

get_hidden_meta_boxes

Definition:
function get_hidden_meta_boxes( $screen ) {}

Get Hidden Meta Boxes

Parameters

  • string|object $screen: Screen identifier

Return values

returns:Hidden Meta Boxes

Source code

function get_hidden_meta_boxes( $screen ) {

	if ( is_string( $screen ) )

		$screen = convert_to_screen( $screen );



	$hidden = get_user_option( "metaboxhidden_{$screen->id}" );

1412