Ticket #14842: 14842.diff
File 14842.diff, 832 bytes (added by , 14 years ago) |
---|
-
wp-includes/capabilities.php
1213 1213 * @return bool True if the user is a site admin. 1214 1214 */ 1215 1215 function is_super_admin( $user_id = false ) { 1216 if ( ! $user_id ) { 1217 $current_user = wp_get_current_user(); 1218 $user_id = ! empty($current_user) ? $current_user->id : 0; 1219 } 1216 global $site_admins; 1220 1217 1221 if ( ! $user_id ) 1218 if ( $user_id ) 1219 $user = new WP_User( $user_id ); 1220 else 1221 $user = wp_get_current_user(); 1222 1223 if ( empty( $user->id ) ) 1222 1224 return false; 1223 1225 1224 $user = new WP_User($user_id);1225 1226 1226 if ( is_multisite() ) { 1227 1227 $super_admins = get_super_admins(); 1228 1228 if ( is_array( $super_admins ) && in_array( $user->user_login, $super_admins ) )