Advertisements

get_admin_users_for_domain

Definition:
function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {}

Get the admin for a domain/path combination.

Parameters

  • string $sitedomain: Optional. Site domain.
  • string $path: Optional. Site path.

Return values

returns:The network admins

Source code

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;

}

1126

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: