Make WordPress Core


Ignore:
Timestamp:
10/01/2015 10:26:19 PM (9 years ago)
Author:
johnbillion
Message:

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

Fixes #34122

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-deprecated.php

    r34753 r34755  
    393393    return $blog_id;
    394394}
     395
     396/**
     397 * Get the admin for a domain/path combination.
     398 *
     399 * @since MU 1.0
     400 * @deprecated 4.4.0
     401 *
     402 * @global wpdb $wpdb
     403 *
     404 * @param string $sitedomain Optional. Site domain.
     405 * @param string $path       Optional. Site path.
     406 * @return array|false The network admins
     407 */
     408function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
     409    _deprecated_function( __FUNCTION__, '4.4' );
     410
     411    global $wpdb;
     412
     413    if ( ! $sitedomain )
     414        $site_id = $wpdb->siteid;
     415    else
     416        $site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) );
     417
     418    if ( $site_id )
     419        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 );
     420
     421    return false;
     422}
Note: See TracChangeset for help on using the changeset viewer.