Opened 5 years ago
Last modified 21 months ago
#37165 new defect (bug)
Problem bulk actions is disabled
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Quick/Bulk Edit | Keywords: | has-screenshots has-patch bulk-reopened |
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 (3)
Change History (11)
#1
@
5 years ago
- Component changed from General to Administration
- Focuses ui added
- Keywords has-screenshots needs-patch added
- Milestone changed from Awaiting Review to Future Release
#6
@
4 years 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
@
4 years 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.
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.