mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Comments: Remove bulk action dropdown depending on user caps.
This changeset adds a conditional to show the comments bulk actions dropdown only when the current user has `moderate_comments` capability. Props snicco, iflairwebtechnologies, shanemuir, audrasjb. Fixes #59440. Built from https://develop.svn.wordpress.org/trunk@59877 git-svn-id: http://core.svn.wordpress.org/trunk@59219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b0efc2929c
commit
2574278658
@ -357,6 +357,10 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
protected function get_bulk_actions() {
|
||||
global $comment_status;
|
||||
|
||||
if ( ! current_user_can( 'moderate_comments' ) ) {
|
||||
return array(); // Return an empty array if the user doesn't have permission
|
||||
}
|
||||
|
||||
$actions = array();
|
||||
|
||||
if ( in_array( $comment_status, array( 'all', 'approved' ), true ) ) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-alpha-59876';
|
||||
$wp_version = '6.8-alpha-59877';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user