Ticket #16702: 16702.patch
File 16702.patch, 1.7 KB (added by , 14 years ago) |
---|
-
wp-includes/deprecated.php
2721 2721 2722 2722 return $user; 2723 2723 } 2724 2725 /** 2726 * Checks if the current user belongs to a given blog. No longer used in core. 2727 * 2728 * @since MU 2729 * @deprecated 3.3.0 2730 * 2731 * @param int $blog_id Blog ID 2732 * @return bool True if the current user belongs to $blog_id, false if not. 2733 */ 2734 function is_blog_user( $blog_id = 0 ) { 2735 _deprecated_function( __FUNCTION__, '3.3' ); 2736 2737 global $wpdb; 2738 2739 $current_user = wp_get_current_user(); 2740 if ( !$blog_id ) 2741 $blog_id = $wpdb->blogid; 2742 2743 $cap_key = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities'; 2744 2745 if ( is_array( $current_user->$cap_key ) && in_array( 1, $current_user->$cap_key ) ) 2746 return true; 2747 2748 return false; 2749 } -
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.