WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/07/2010 03:50:46 PM (10 years ago)
Author:
ryan
Message:

Deprecate is_site_admin. Props nacin. see #11644

File:
1 edited

Legend:

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

    r12643 r12645  
    182182    global $current_user;
    183183    return $current_user->ID;
    184 }
    185 
    186 /**
    187  * Determine if user is a site admin.
    188  *
    189  * @deprecated Use {@link is_keymaster()}
    190  *
    191  */
    192 function is_site_admin( $user_login = '' ) {
    193     // This function must reside in a file included only if is_multsite() since many plugins
    194     // test for its existence to determine if multisite is enabled.
    195 
    196     if ( empty($user_login) ) {
    197         $user_id = get_current_user_id();
    198         if ( !$user_id )
    199             return false;
    200     } else {
    201         $user = new WP_User(null, $user_login);
    202         if ( empty($user->id) )
    203             return false;
    204         $user_id = $user->id;
    205     }
    206 
    207     return is_super_admin($user_id);
    208184}
    209185
Note: See TracChangeset for help on using the changeset viewer.