WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get blog details

Contents

Description

Retrieve the details for a blog from the blogs table and blog options.

See: WPMU_Functions/get_blog_details

Usage

<?php get_blog_details$fields$get_all ); ?>

Parameters

$fields
(int|string|array) (optional) A blog ID, a blog slug, or an array of fields to query against. If not specified the current blog ID is used.
Default: null
$get_all
(boolean) (optional) Whether to retrieve all details or only the details in the blogs table.
Default: true

Return Value

<?php get_blog_details(1); ?>  would return:

   [blog_id]      => 1
   [site_id]      => 1
   [domain]       => foo-multi-site.com
   [path]         => /site-path/
   [registered]   => 2014-07-31 14:51:09
   [last_updated] => 2014-07-31 15:51:56
   [public]       => 1
   [archived]     => 0
   [mature]       => 0
   [spam]         => 0
   [deleted]      => 0
   [lang_id]      => 0
   [blogname]     => Site Name
   [siteurl]      => http://foo-multi-site.com/this-site
   [post_count]   => 
(WP_Object_Cache object) 
Blog details

Examples


Notes

Uses global $wpdb

Changelog

Since: 3.0.0

Source File

get_blog_details() is located in wp-includes/ms-blogs.php.

Related

 

See also index of Function Reference and index of Template Tags.