WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 21 months ago

#37165 new defect (bug)

Problem bulk actions is disabled

Reported by: sebastian.pisula Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Quick/Bulk Edit Keywords: has-screenshots has-patch needs-testing
Focuses: ui Cc:

Description

I have this filter: add_filter( 'bulk_actions-{$this->screen->id}', '__return_empty_array' ); and in page I have space because I have empty div:

<div class="alignleft actions bulkactions"></div>

Problem is in wp-admin/includes/class-wp-list-table.php:1182:

<?php
 if ( $this->has_items() ): ?>
                <div class="alignleft actions bulkactions">
                        <?php $this->bulk_actions( $which ); ?>
                </div>
                <?php endif;

Attachments (2)

space.png (2.8 KB) - added by sebastian.pisula 2 years ago.
37165.diff (1.1 KB) - added by andizer 21 months ago.

Download all attachments as: .zip

Change History (9)

#1 @afercia
23 months ago

  • Component changed from General to Administration
  • Focuses ui added
  • Keywords has-screenshots needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Ideally empty elements shouldn't be printed out, worth investigating what can be done on the PHP side. Alternatively a CSS-only solution could work.

#2 @SergeyBiryukov
23 months ago

  • Component changed from Administration to Quick/Bulk Edit

@andizer
21 months ago

#3 @andizer
21 months ago

Just added a patch to solve this. Feedback is welcome.

#4 @andizer
21 months ago

  • Keywords has-patch added; needs-patch removed

#5 @andizer
21 months ago

  • Keywords needs-testing added

#6 @flixos90
21 months ago

Hi @andizer, the patch looks good in my opinion as far as it fixes the issue. :) We might need to be careful with the change since when the bulk_actions() method is overridden in a subclass, the change could lead to issues since the wrapping div would be gone then. On the other hand, I think it's rather unlikely to override this method since one should preferably use get_bulk_actions() for that purpose, so I tend to say we're fine applying this change. I'm just thinking out loud here to make sure we consider this possibility.

#7 @afercia
21 months ago

Even if the bulk actions div is not printed out, the wrapper .tablenav has always a fixed height of 30px, so the empty space will still be there, unless I'm missing something. .tablenav can also contain the pagination links and the number of items, not to mention additional filters.

Note: See TracTickets for help on using tickets.