Make WordPress Core

Ticket #30991: 30991-check_for_optional_variable_set_before_using.diff

File 30991-check_for_optional_variable_set_before_using.diff, 629 bytes (added by jipmoors, 10 years ago)

isset on capability option check for optional capability

  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    208208                        $actions['edit'] = __( 'Edit' );
    209209                }
    210210
    211                 if ( current_user_can( $post_type_obj->cap->delete_posts ) ) {
     211                if ( isset($post_type_obj->cap->delete_posts) && current_user_can( $post_type_obj->cap->delete_posts ) ) {
    212212                        if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) {
    213213                                $actions['delete'] = __( 'Delete Permanently' );
    214214                        } else {