WordPress.org

Make WordPress Core

Ticket #29789: 29789.diff

File 29789.diff, 1.3 KB (added by DrewAPicture, 4 years ago)
  • src/wp-admin/includes/class-wp-list-table.php

     
    11211121?>
    11221122        <div class="tablenav <?php echo esc_attr( $which ); ?>">
    11231123
    1124                 <div class="alignleft actions bulkactions">
    1125                         <?php $this->bulk_actions( $which ); ?>
    1126                 </div>
     1124                <?php if ( ! empty( $this->get_bulk_actions() ) ) : ?>
     1125                        <div class="alignleft actions bulkactions">
     1126                                <?php $this->bulk_actions( $which ); ?>
     1127                        </div>
     1128                <?php endif; ?>
    11271129<?php
    11281130                $this->extra_tablenav( $which );
    11291131                $this->pagination( $which );
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    282282                $actions = array();
    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
    285290                if ( $this->is_trash ) {
    286291                        $actions['untrash'] = __( 'Restore' );
    287292                } else {