get_id_from_blogname [ WordPress Function ]
get_id_from_blogname ( $name )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: get_date_from_gmt, get_gmt_from_date, get_blog_id_from_url, get_user_id_from_string, get_users_of_blog
Given a blog's (subdomain or directory) name, retrieve it's id.
Source
<?php
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) );
wp_cache_set( 'get_id_from_blogname_' . $name, $blog_id, 'blog-details' );
return $blog_id;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get id from blogname « WordPress Codex
Function Reference/get id from blogname ... Source File. get_id_from_blogname( ) is located in wp-includes/ms-blogs.php. Retrieved from ...
codex.wordpress.org - get_id_from_blogname - Function Reference - PHP Cross ...
Jun 1, 2011 ... Function and Method Cross Reference. get_id_from_blogname(). Defined at: /wp -includes/ms-blogs.php -> line 89. Referenced 2 times: ...
xref.yoast.com - get_id_from_blogname | A HitchHackers guide through WordPress
Feb 12, 2011 ... Source code. function get_id_from_blogname( $name ) { global $wpdb, $ current_site; $blog_id = wp_cache_get( 'get_id_from_blogname_' .
hitchhackerguide.com - get_id_from_blogname (WordPress Function) - WPSeek.com
WordPress lookup for get_id_from_blogname, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com