Ticket #21120: 21120.3.diff
File 21120.3.diff, 1.2 KB (added by , 12 years ago) |
---|
-
wordpress/wp-includes/capabilities.php
1381 1381 */ 1382 1382 function is_super_admin( $user_id = false ) { 1383 1383 if ( $user_id ) 1384 $user = new WP_User( $user_id );1384 $user = get_userdata( $user_id ); 1385 1385 else 1386 1386 $user = wp_get_current_user(); 1387 1387 -
wordpress/wp-includes/pluggable.php
114 114 * 115 115 * @since 0.71 116 116 * 117 * @param int $user_id User ID 117 * @param int $user_id User ID. 118 118 * @return bool|object False on failure, WP_User object on success 119 119 */ 120 120 function get_userdata( $user_id ) { … … 133 133 * @return bool|object False on failure, WP_User object on success 134 134 */ 135 135 function get_user_by( $field, $value ) { 136 if ( 'id' === $field && $value && get_current_user_id() === $value ) 137 return wp_get_current_user(); 138 136 139 $userdata = WP_User::get_data_by( $field, $value ); 137 140 138 141 if ( !$userdata )