mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Add get_users_of_blog()
git-svn-id: http://svn.automattic.com/wordpress/trunk@4852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e71e25d354
commit
73a225e4e6
@ -50,6 +50,16 @@ function update_user_option( $user_id, $option_name, $newvalue, $global = false
|
||||
return update_usermeta( $user_id, $option_name, $newvalue );
|
||||
}
|
||||
|
||||
// Get users with capabilities for the current blog.
|
||||
// For setups that use the multi-blog feature.
|
||||
function get_users_of_blog( $id = '' ) {
|
||||
global $wpdb, $blog_id;
|
||||
if ( empty($id) )
|
||||
$id = $blog_id;
|
||||
$users = $wpdb->get_results( "SELECT user_id, user_login, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE " . $wpdb->users . ".ID = " . $wpdb->usermeta . ".user_id AND meta_key = '" . $wpdb->table_prefix . "_capabilities' ORDER BY {$wpdb->usermeta}.user_id" );
|
||||
return $users;
|
||||
}
|
||||
|
||||
//
|
||||
// User meta functions
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user