[wp-trac] [WordPress Trac] #41688: Wrong term pagination when altering the term query in custom taxonomy terms list

WordPress Trac noreply at wordpress.org
Mon Aug 21 17:16:11 UTC 2017


#41688: Wrong term pagination when altering the term query in custom taxonomy terms
list
------------------------------------------+-----------------------------
 Reporter:  opportus                      |      Owner:
     Type:  defect (bug)                  |     Status:  new
 Priority:  normal                        |  Milestone:  Awaiting Review
Component:  Administration                |    Version:
 Severity:  normal                        |   Keywords:
  Focuses:  ui, administration, template  |
------------------------------------------+-----------------------------
 WP outputs the wrong term pagination if we alter the term query in custom
 taxonomy terms list with for example the `list_terms_exclusions` filter
 hook.
 In the screenshot below, we should have only 3 items in the pagination,
 but as you can see we get 21 items instead.

 [[Image(https://i.imgur.com/pFUCG8P.png)]]

 I believe the problem comes from this line:

 https://github.com/WordPress/WordPress/blob/master/wp-admin/includes
 /class-wp-terms-list-table.php#L125

 {{{#!php
 'total_items' => wp_count_terms( $this->screen->taxonomy, compact(
 'search' ) ),
 }}}

 Shouldn't the pagination be defined based on the term query's **result**
 instead?

 For more details about this issue, see:

 https://wordpress.stackexchange.com/questions/277088/filter-taxonomy-
 admin-pagination/277590#277590

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41688>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list