[wp-trac] [WordPress Trac] #49411: Missing 'wp_count_terms' filter

WordPress Trac noreply at wordpress.org
Tue Feb 11 20:48:20 UTC 2020


#49411: Missing 'wp_count_terms' filter
-----------------------------+-----------------------------
 Reporter:  ddu66            |      Owner:  (none)
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Taxonomy         |    Version:  trunk
 Severity:  normal           |   Keywords:  needs-patch
  Focuses:                   |
-----------------------------+-----------------------------
 As previously requested by krizkroz (ticket #40696, 3 years ago), function
 {{{wp_count_terms}}} (wp-includes/taxonomy.php) should filter before
 returning, exactly the same way function {{{wp_count_posts}}} does (wp-
 includes/posts.php).

 Currently, **get_terms** filter permit to change the terms that are
 displayed in the admin screen, but without filter, there is no way to
 adapt pagination buttons (prev/next/first/last/goto page buttons) that
 always reflect the number of terms contained in database instead of those
 filtered/displayed.

 To conclude, function {{{wp_count_terms}}} should end by:

 {{{
 return apply_filters('wp_count_terms', get_terms($taxonomy, $args),
 $taxonomy, $args);
 }}}

 instead of:

 {{{
 return get_terms($taxonomy, $args);
 }}}

 Thanks.
 Damien

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


More information about the wp-trac mailing list