mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Reduce use of global. Use get_blog_details() instead. fixes #22090
git-svn-id: https://develop.svn.wordpress.org/trunk@22108 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -118,11 +118,11 @@ function get_id_from_blogname( $slug ) {
|
||||
*
|
||||
* @since MU
|
||||
*
|
||||
* @param int|string|array $fields A blog ID, a blog slug, or an array of fields to query against.
|
||||
* @param int|string|array $fields A blog ID, a blog slug, or an array of fields to query against. Optional. If not specified the current blog ID is used.
|
||||
* @param bool $get_all Whether to retrieve all details or only the details in the blogs table. Default is true.
|
||||
* @return object Blog details.
|
||||
*/
|
||||
function get_blog_details( $fields, $get_all = true ) {
|
||||
function get_blog_details( $fields = null, $get_all = true ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( is_array($fields ) ) {
|
||||
@@ -166,7 +166,9 @@ function get_blog_details( $fields, $get_all = true ) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if ( !is_numeric( $fields ) )
|
||||
if ( ! $fields )
|
||||
$blog_id = get_current_blog_id();
|
||||
elseif ( ! is_numeric( $fields ) )
|
||||
$blog_id = get_id_from_blogname( $fields );
|
||||
else
|
||||
$blog_id = $fields;
|
||||
|
||||
Reference in New Issue
Block a user