Opened 6 years ago
Closed 6 years ago
#49411 closed feature request (duplicate)
Missing 'wp_count_terms' filter
| Reported by: | ddu66 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | 5.4 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
Description
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
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Since the original ticket #40696 is still open, let's continue the discussion there. Thanks again!