mirror of
git://develop.git.wordpress.org/
synced 2025-03-20 12:00:03 +01: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. git-svn-id: https://develop.svn.wordpress.org/trunk@59877 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b607715ba7
commit
bbdd9fb4a9
@ -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 ) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user