From 7a89d0a2652d97894cebc6edf5221f0ce76f0714 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 28 May 2023 11:44:24 +0000 Subject: [PATCH] Users: Make sure bulk actions are only executed with the Apply button, not Change. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Change button is supposed to perform the “Change role to...” action only, but could unintentionally be used for other bulk actions if the role was not selected. This commit removes an extra check and ensures the correct error message is displayed in that case: Sorry, you are not allowed to give users that role. Follow-up to [6990], [8691], [9028], [15576], [15642], [34636], [49944]. Props haritpanchal, costdev, ankit-k-gupta, SergeyBiryukov. Fixes #57952. git-svn-id: https://develop.svn.wordpress.org/trunk@55864 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-users-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-users-list-table.php b/src/wp-admin/includes/class-wp-users-list-table.php index c2cd68102d..0426603342 100644 --- a/src/wp-admin/includes/class-wp-users-list-table.php +++ b/src/wp-admin/includes/class-wp-users-list-table.php @@ -353,7 +353,7 @@ class WP_Users_List_Table extends WP_List_Table { * @return string The bulk action required. */ public function current_action() { - if ( isset( $_REQUEST['changeit'] ) && ! empty( $_REQUEST['new_role'] ) ) { + if ( isset( $_REQUEST['changeit'] ) ) { return 'promote'; }