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
This commit is contained in:
Scott Taylor 2015-08-23 16:27:44 +00:00
parent dfa9da5356
commit 9596ae0993

View File

@ -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 {