[wp-trac] [WordPress Trac] #44821: Add filter for custom taxonomy per page value in `WP_Term_List_Table`

WordPress Trac noreply at wordpress.org
Thu Sep 27 19:30:50 UTC 2018


#44821: Add filter for custom taxonomy per page value in `WP_Term_List_Table`
--------------------------------------------+-----------------------------
 Reporter:  desrosj                         |       Owner:  (none)
     Type:  enhancement                     |      Status:  new
 Priority:  normal                          |   Milestone:  4.9.9
Component:  Taxonomy                        |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  good-first-bug has-patch close  |     Focuses:  administration
--------------------------------------------+-----------------------------
Changes (by desrosj):

 * keywords:  good-first-bug has-patch => good-first-bug has-patch close


Comment:

 I think that I created a ticket prematurely.

 In reviewing [attachment:"44821.4.diff"], I noticed that the
 `WP_List_Table->get_items_per_page()` method will actually pass the value
 through a dynamic filter with the exact same name as the `$option`
 parameter passed to it. Given a custom taxonomy called `my_custom_tax`,
 the filter that runs would be called `edit_my_custom_tax_per_page`. This
 has been in place since [15569], but is not immediately obvious in classes
 extending `WP_List_Table`.

 The `edit_tags_per_page` and `edit_categories_per_page` were old filter
 names that seem to be left for backward compatibility.

 `WP_Posts_List_Table` is the only other `WP_List_Table` that applies a
 filter to the per page value (`edit_posts_per_page`), but, this filter is
 called in two other places in core, and is different than
 `edit_post_per_page` (singular) which would be called by the
 `WP_List_Table->get_items_per_page()` method.

 I am marking this as a `close` candidate. The goal of this ticket is
 already possible.

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


More information about the wp-trac mailing list