Make WordPress Core


Ignore:
Timestamp:
08/12/2017 12:47:38 PM (7 years ago)
Author:
flixos90
Message:

Multisite: Rename internal $site_id variables referencing networks to $network_id.

This change improves code clarity by using the current naming conventions for networks.

Props lemacarl.
Fixes #41510.

File:
1 edited

Legend:

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

    r41200 r41241  
    421421 * @global wpdb $wpdb WordPress database abstraction object.
    422422 *
    423  * @param string $sitedomain Optional. Site domain.
    424  * @param string $path       Optional. Site path.
    425  * @return array|false The network admins
    426  */
    427 function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
     423 * @param string $domain Optional. Network domain.
     424 * @param string $path   Optional. Network path.
     425 * @return array|false The network admins.
     426 */
     427function get_admin_users_for_domain( $domain = '', $path = '' ) {
    428428    _deprecated_function( __FUNCTION__, '4.4.0' );
    429429
    430430    global $wpdb;
    431431
    432     if ( ! $sitedomain )
    433         $site_id = $wpdb->siteid;
     432    if ( ! $domain )
     433        $network_id = $wpdb->siteid;
    434434    else
    435         $site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) );
    436 
    437     if ( $site_id )
    438         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 );
     435        $network_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $domain, $path ) );
     436
     437    if ( $network_id )
     438        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", $network_id ), ARRAY_A );
    439439
    440440    return false;
Note: See TracChangeset for help on using the changeset viewer.