Warning: This function has been deprecated.

get_admin_users_for_domain() WordPress Function

The get_admin_users_for_domain() function is used to retrieve a list of administrators for a specified domain. This function is useful for sites that have multiple administrators with different roles.

get_admin_users_for_domain( string $domain = '', string $path = '' ) #

Get the admin for a domain/path combination.


Parameters

$domain

(string)(Optional) Network domain.

Default value: ''

$path

(string)(Optional) Network path.

Default value: ''


Top ↑

Return

(array|false) The network admins.


Top ↑

Source

File: wp-includes/ms-deprecated.php

function get_admin_users_for_domain( $domain = '', $path = '' ) {
	_deprecated_function( __FUNCTION__, '4.4.0' );

	global $wpdb;

	if ( ! $domain ) {
		$network_id = get_current_network_id();
	} else {
		$_networks  = get_networks( array(
			'fields' => 'ids',
			'number' => 1,
			'domain' => $domain,
			'path'   => $path,
		) );
		$network_id = ! empty( $_networks ) ? array_shift( $_networks ) : 0;
	}

	if ( $network_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", $network_id ), ARRAY_A );

	return false;
}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0This function has been deprecated.
MU (3.0.0)Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.