From 9596ae09933e5c6841bcd1ae03818088b2a9c379 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 23 Aug 2015 16:27:44 +0000 Subject: [PATCH] Posts List Table: Don't show bulk actions if the user can't edit posts. Props DrewAPicture. Fixes #29789. git-svn-id: https://develop.svn.wordpress.org/trunk@33713 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-posts-list-table.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 24d9e0f90c..0e55c6372c 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -282,6 +282,11 @@ class WP_Posts_List_Table extends WP_List_Table { $actions = array(); $post_type_obj = get_post_type_object( $this->screen->post_type ); + // Don't show bulk options if the user can't edit posts. + if ( ! current_user_can( $post_type_obj->cap->edit_posts ) ) { + return $actions; + } + if ( $this->is_trash ) { $actions['untrash'] = __( 'Restore' ); } else {