Instead of [33713], allow WP_Posts_List_Table::get_bulk_actions() to check edit_posts AND delete_posts.

Props DeBAAT.
Fixes #29789.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-08-25 20:12:22 +00:00
parent 85d3345e05
commit c2a0336d22
2 changed files with 7 additions and 10 deletions

View File

@ -282,16 +282,13 @@ 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 ) ) {
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 {
$actions['edit'] = __( 'Edit' ); $actions['edit'] = __( 'Edit' );
} }
}
if ( current_user_can( $post_type_obj->cap->delete_posts ) ) { if ( current_user_can( $post_type_obj->cap->delete_posts ) ) {
if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) { if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-33732'; $wp_version = '4.4-alpha-33733';
/** /**
* 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.