Http://www.utubon.com/1495/wordpress-multisite-get-current-bolg-info
Global $current _blog;
Its return result is:
StdClass Object ( [blog_id] = 3 [site_id] = 1 [domain] = demo.utubon.com [path] =/ neighborhood/ [Registered] = 2013-08-01 10:31:03 [last_updated] = 2013-08-01 02:31:03 [public] = > 1 [archived] + 0 [Mature] = 0 [spam] + 0 [deleted] = 0 [lang_id] + 0)
You can also use the get_blog_details function:
$current _blog = Get_blog_details ();
Its return result is:
StdClass Object ( [blog_id] = 3 [site_id] = 1 [domain] = demo.utubon.com [path] =/ neighborhood/ [Registered] = 2013-08-01 10:31:03 [last_updated] = 2013-08-01 02:31:03 [public] = > 1 [archived] + 0 [Mature] = 0 [spam] + 0 [deleted] = 0 [lang_id] + 0 [Blogname] = Neighborhood [SiteURL] = Http://demo.utubon.com/neighborhood [Post_count] =// More information than global $current _blog
This basically satisfies our needs, but there is a more mealy way to use the get_blog_id_from_url function. If your multisite is in the form of subdirectories, use:
$blog _id = Get_blog_id_from_url ("example.com", "/blog1/");
If you are using a subdomain name, use:
$blog _id = Get_blog_id_from_url ("blog1.example.com");
And above these parameters, we can use $_server[' server_name ' and $_server["Request_uri"] get.
All sorts of things will be done after getting $blog_id.
http://www.bkjia.com/PHPjc/738537.html www.bkjia.com true http://www.bkjia.com/PHPjc/738537.html techarticle Http://www.utubon.com/1495/wordpress-multisite-get-current-bolg-info Global $current _blog; The return result is: StdClass Object ([blog_id] = 3 [site_id] = 1 [domain] = Demo.utu ...