Deprecate `get_admin_users_for_domain()`. This function has never been used in core.

Fixes #34122

Built from https://develop.svn.wordpress.org/trunk@34755


git-svn-id: http://core.svn.wordpress.org/trunk@34720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2015-10-01 22:27:24 +00:00
parent f33c6a6650
commit ea28454867
3 changed files with 29 additions and 26 deletions

View File

@ -392,3 +392,31 @@ function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
return $blog_id; return $blog_id;
} }
/**
* Get the admin for a domain/path combination.
*
* @since MU 1.0
* @deprecated 4.4.0
*
* @global wpdb $wpdb
*
* @param string $sitedomain Optional. Site domain.
* @param string $path Optional. Site path.
* @return array|false The network admins
*/
function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
_deprecated_function( __FUNCTION__, '4.4' );
global $wpdb;
if ( ! $sitedomain )
$site_id = $wpdb->siteid;
else
$site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) );
if ( $site_id )
return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id ), ARRAY_A );
return false;
}

View File

@ -23,31 +23,6 @@ function get_sitestats() {
return $stats; return $stats;
} }
/**
* Get the admin for a domain/path combination.
*
* @since MU 1.0
*
* @global wpdb $wpdb
*
* @param string $sitedomain Optional. Site domain.
* @param string $path Optional. Site path.
* @return array|false The network admins
*/
function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
global $wpdb;
if ( ! $sitedomain )
$site_id = $wpdb->siteid;
else
$site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) );
if ( $site_id )
return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id ), ARRAY_A );
return false;
}
/** /**
* Get one of a user's active blogs * Get one of a user's active blogs
* *

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-34754'; $wp_version = '4.4-alpha-34755';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.