Ticket #16702: 16702.2.patch
File 16702.2.patch, 1.8 KB (added by , 13 years ago) |
---|
-
wp-includes/ms-deprecated.php
200 200 } 201 201 return array_slice( $most_active, 0, $num ); 202 202 } 203 204 /** 205 * Checks if the current user belongs to a given blog. No longer used in core. 206 * 207 * @since MU 208 * @deprecated 3.3.0 209 * @deprecated Use get_blogs_of_user() 210 * @see get_blogs_of_user() 211 * 212 * @param int $blog_id Blog ID 213 * @return bool True if the current user belongs to $blog_id, false if not. 214 */ 215 function is_blog_user( $blog_id = 0 ) { 216 _deprecated_function( __FUNCTION__, '3.3' ); 217 218 global $wpdb; 219 220 $current_user = wp_get_current_user(); 221 if ( !$blog_id ) 222 $blog_id = $wpdb->blogid; 223 224 $cap_key = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities'; 225 226 if ( is_array( $current_user->$cap_key ) && in_array( 1, $current_user->$cap_key ) ) 227 return true; 228 229 return false; 230 } 203 231 ?> -
wp-includes/user.php
717 717 } 718 718 719 719 /** 720 * Checks if the current user belong to a given blog.721 *722 * @since 3.0.0723 *724 * @param int $blog_id Blog ID725 * @return bool True if the current users belong to $blog_id, false if not.726 */727 function is_blog_user( $blog_id = 0 ) {728 global $wpdb;729 730 $current_user = wp_get_current_user();731 if ( !$blog_id )732 $blog_id = $wpdb->blogid;733 734 $cap_key = $wpdb->base_prefix . $blog_id . '_capabilities';735 736 if ( is_array($current_user->$cap_key) && in_array(1, $current_user->$cap_key) )737 return true;738 739 return false;740 }741 742 /**743 720 * Add meta data field to a user. 744 721 * 745 722 * Post meta data is called "Custom Fields" on the Administration Screens.