get_admin_users_for_domain()
Deprecated since 4.4.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Get the admin for a domain/path combination.
No Hooks.
Returns
Array|false
. The network admins.
Usage
get_admin_users_for_domain( $domain, $path );
- $domain(string)
- Network domain.
Default: '' - $path(string)
- Network path.
Default: ''
Notes
- Global. wpdb. $wpdb WordPress database abstraction object.
Changelog
Since 3.0.0 | Introduced. |
Deprecated since | 4.4.0 |
get_admin_users_for_domain() get admin users for domain code WP 6.8.1
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; }