WordPress Development Asked by Debiprasad on January 23, 2021
I am sorting results appear on the category archive page using these filters: posts_join
and posts_orderby
. There is a widget, which displays recent posts. I am using default recent posts widget of WordPress. But it’s not showing any result. When I investigated I found that the applied filters are getting applied to this query. So, I tried remove the filters using the following code:
remove_filter('posts_join', 'my_filter_join');
remove_filter('posts_orderby', 'my_filter_orderby');
But still it does not work.
I also tried to put the following code in the filter functions itself:
// Disable this filter for future queries!
remove_filter(current_filter(), __FUNCTION__);
It does not work either.
How to fix this issue?
There is a couple of ways to achieve this,
suppress_filters
is set to false (the default). This would ensure your filters are not fired for this query.Answered by Aurovrata on January 23, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP