mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-09 15:14:37 +00:00
Users: Use the role name instead of the role display name when fetching the list of users with no role. This avoids false positives when dealing with user roles that, for example, contain spaces in the display name.
Props procodewp, choongsavvii Fixes #38234 git-svn-id: https://develop.svn.wordpress.org/trunk@38787 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2440,7 +2440,7 @@ function wp_get_users_with_no_role() {
|
||||
}
|
||||
|
||||
$prefix = $wpdb->get_blog_prefix();
|
||||
$regex = implode( '|', wp_roles()->get_names() );
|
||||
$regex = implode( '|', array_keys( wp_roles()->get_names() ) );
|
||||
$regex = preg_replace( '/[^a-zA-Z_\|-]/', '', $regex );
|
||||
$users = $wpdb->get_col( $wpdb->prepare( "
|
||||
SELECT user_id
|
||||
|
||||
Reference in New Issue
Block a user