Ticket #16702: 16702.diff
File 16702.diff, 1.7 KB (added by , 14 years ago) |
---|
-
wp-includes/user.php
715 715 } 716 716 717 717 /** 718 * Checks if the current user belong to a given blog.719 *720 * @since 3.0.0721 *722 * @param int $blog_id Blog ID723 * @return bool True if the current users belong to $blog_id, false if not.724 */725 function is_blog_user( $blog_id = 0 ) {726 global $wpdb;727 728 $current_user = wp_get_current_user();729 if ( !$blog_id )730 $blog_id = $wpdb->blogid;731 732 $cap_key = $wpdb->base_prefix . $blog_id . '_capabilities';733 734 if ( is_array($current_user->$cap_key) && in_array(1, $current_user->$cap_key) )735 return true;736 737 return false;738 }739 740 /**741 718 * Add meta data field to a user. 742 719 * 743 720 * Post meta data is called "Custom Fields" on the Administration Panels. -
wp-includes/deprecated.php
2602 2602 return true; 2603 2603 } 2604 2604 2605 /** 2606 * Checks if the current user belong to a given blog. No longer used in core. 2607 * 2608 * @since MU 2609 * @deprecated 3.2 2610 * 2611 * @param int $blog_id Blog ID 2612 * @return bool True if the current user belongs to $blog_id, false if not. 2613 */ 2614 function is_blog_user( $blog_id = 0 ) { 2615 _deprecated_function( __FUNCTION__, '3.2' ); 2616 2617 global $wpdb; 2618 2619 $current_user = wp_get_current_user(); 2620 2621 if ( !$blog_id ) 2622 $blog_id = $wpdb->blogid; 2623 2624 $cap_key = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities'; 2625 2626 if ( is_array( $current_user->$cap_key ) && in_array( 1, $current_user->$cap_key ) ) 2627 return true; 2628 2629 return false; 2630 } 2631