Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_admin_users_for_domain [ WordPress Function ]

get_admin_users_for_domain ( $sitedomain = '', $path = '' )
Parameters:
  • (string) $sitedomain Optional. Site domain.
  • (string) $path Optional. Site path.
Returns:
  • (array) The network admins
Defined at:



Get the admin for a domain/path combination.

Source


<?php
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;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics