From ed81797117a72aa5ae26e6a37ce1188df9715205 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 1 Oct 2015 22:26:19 +0000 Subject: [PATCH] Deprecate `get_admin_users_for_domain()`. This function has never been used in core. Fixes #34122 git-svn-id: https://develop.svn.wordpress.org/trunk@34755 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/ms-deprecated.php | 28 ++++++++++++++++++++++++++++ src/wp-includes/ms-functions.php | 25 ------------------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/wp-includes/ms-deprecated.php b/src/wp-includes/ms-deprecated.php index 5ef393b275..8c6fb2411a 100644 --- a/src/wp-includes/ms-deprecated.php +++ b/src/wp-includes/ms-deprecated.php @@ -392,3 +392,31 @@ function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { 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; +} diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php index 9bf4ca76d5..f18d644625 100644 --- a/src/wp-includes/ms-functions.php +++ b/src/wp-includes/ms-functions.php @@ -23,31 +23,6 @@ function get_sitestats() { 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 *