WordPress.org

Make WordPress Core

Changeset 33733


Ignore:
Timestamp:
08/25/2015 08:11:27 PM (4 years ago)
Author:
wonderboymusic
Message:

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

Props DeBAAT.
Fixes #29789.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r33731 r33733  
    283283        $post_type_obj = get_post_type_object( $this->screen->post_type );
    284284
    285         // Don't show bulk options if the user can't edit posts.
    286         if ( ! current_user_can( $post_type_obj->cap->edit_posts ) ) {
    287             return $actions;
    288         }
    289 
    290         if ( $this->is_trash ) {
    291             $actions['untrash'] = __( 'Restore' );
    292         } else {
    293             $actions['edit'] = __( 'Edit' );
     285        if ( current_user_can( $post_type_obj->cap->edit_posts ) ) {
     286            if ( $this->is_trash ) {
     287                $actions['untrash'] = __( 'Restore' );
     288            } else {
     289                $actions['edit'] = __( 'Edit' );
     290            }
    294291        }
    295292
Note: See TracChangeset for help on using the changeset viewer.