Table of Content
Introduction Introduction
If you are working on multisite then you have an idea about the function get_blog_details().
The function get_blog_details() retrieve the details for a blog from the blog’s table and blog options.
Syntax Syntax
get_blog_details( $fields = null, $get_all = true )
- $fields = A blog ID, a blog slug, or an array of fields to query against.
- $get_all = Whether to retrieve all details or only the details in the blogs table.
Example Example
add_action( 'admin_head', function() { var_dump( get_blog_details() ); });
After executing the function we see the output something likebelow.
WP_Site Object ( [blog_id] => 2 [domain] => localhost [path] => /dev.multisite/site-1/ [site_id] => 1 [registered] => 2020-03-12 06:19:52 [last_updated] => 2020-03-16 09:20:26 [public] => 1 [archived] => 0 [mature] => 0 [spam] => 0 [deleted] => 0 [lang_id] => 0 [blogname] => Site 1 [siteurl] => http://localhost/dev.multisite/site-1 [post_count] => [home] => http://localhost/dev.multisite/site-1 )