Show specific taxonomy values ?
-
Hi
I use Posts Table Pro, where i have two magazines i would like to show.
My problem is that i have to use Lazy Load because of the total posts is over 11.000, and therefor i cannot use exclude_term to remove the years in the filter dropdown for the secondary magazine which was only published for 15 years.
It’s a bad user experience having them to click and chose through a lot of filter-years which have no posts, so i need to cut the filter via php and add_filter.
I’m just not sure how to do this ??
posts_table_search_filter_terms_<taxonomy>
Filters the terms to use in the search filter dropdown list. The filter name is dynamic – replace <taxonomy> with the relevant taxonomy slug.add_filter( 'posts_table_search_filter_terms_category', function( $terms, $taxonomy,Posts_Table_Args $table_args ) { // Do something with terms return $terms; }, 10, 3 );
I need to target a specific page with this function, so it doesn’t disrupt the primary magazine which is still being published. And i need to show only years 1941-1950 and 1956-1967 ?
All the best
Carsten
- The topic ‘Show specific taxonomy values ?’ is closed to new replies.