[wp-trac] [WordPress Trac] #54181: Terms management screen shows bulk actions dropdown even if there are no terms

WordPress Trac noreply at wordpress.org
Thu Oct 7 01:26:24 UTC 2021


#54181: Terms management screen shows bulk actions dropdown even if there are no
terms
-------------------------------------------------+-------------------------
 Reporter:  swissspidy                           |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.9
Component:  Taxonomy                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch commit      |     Focuses:
  has-screenshots                                |  administration
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 [attachment:"54181.3.diff"] implements comment:7 by:
 * Moving the `get_terms()` call from `display_rows_or_placeholder()` to
 `prepare_items()`.
 * Populating `$this->items` property in `prepare_items()`.
 * Removing the `has_items()` override, no longer needed.

 With these changes, the parent `WP_List_Table::has_items()` method works
 as expected, and the bulk actions dropdown is not displayed if there are
 no terms.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54181#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list