Posts List Table:

Don't show bulk actions if the user can't edit posts.

Props DrewAPicture.
Fixes #29789.

Built from https://develop.svn.wordpress.org/trunk@33713


git-svn-id: http://core.svn.wordpress.org/trunk@33680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-08-23 16:28:28 +00:00
parent dffa53dca8
commit b1c00f2653
2 changed files with 6 additions and 1 deletions

View File

@ -282,6 +282,11 @@ class WP_Posts_List_Table extends WP_List_Table {
$actions = array(); $actions = array();
$post_type_obj = get_post_type_object( $this->screen->post_type ); $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 ) { if ( $this->is_trash ) {
$actions['untrash'] = __( 'Restore' ); $actions['untrash'] = __( 'Restore' );
} else { } else {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-33712'; $wp_version = '4.4-alpha-33713';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.