get_blog_status() WordPress Function
The get_blog_status() function in WordPress allows you to get the status of a blog by its ID. This is useful for checking if a blog is active or not.
get_blog_status( int $id, string $pref ) #
Get a blog details field.
Parameters
- $id
(int)(Required)Blog ID.
- $pref
(string)(Required)Field name.
Return
(bool|string|null) $value
Source
File: wp-includes/ms-blogs.php
function get_blog_status( $id, $pref ) { global $wpdb; $details = get_site( $id ); if ( $details ) { return $details->$pref; } return $wpdb->get_var( $wpdb->prepare( "SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d", $pref, $id ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
MU (3.0.0) | Introduced. |