Changeset 19016 for trunk/wp-includes/ms-functions.php
- Timestamp:
- 10/19/2011 10:35:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/ms-functions.php
r18899 r19016 117 117 return $primary; 118 118 } 119 }120 121 /**122 * Find out whether a user is a member of a given blog.123 *124 * @since MU 1.1125 * @uses get_blogs_of_user()126 *127 * @param int $user_id The unique ID of the user128 * @param int $blog Optional. If no blog_id is provided, current site is used129 * @return bool130 */131 function is_user_member_of_blog( $user_id, $blog_id = 0 ) {132 $user_id = (int) $user_id;133 $blog_id = (int) $blog_id;134 135 if ( $blog_id == 0 ) {136 global $wpdb;137 $blog_id = $wpdb->blogid;138 }139 140 $blogs = get_blogs_of_user( $user_id );141 if ( is_array( $blogs ) )142 return array_key_exists( $blog_id, $blogs );143 else144 return false;145 119 } 146 120
Note: See TracChangeset
for help on using the changeset viewer.