_prime_post_caches in wordpress

These bits of caching are generally considered inadvisable to be messed with. If I remember right you can somewhat control the behavior by query arguments and wrapping related code in wp_suspend_cache_addition() calls. From look through the source it doesn’t seem to be meant to carry custom logic. If you would like similar behavior for your … Read more

Add a filter inside an action init

To alter the page ID before the query is run, hook the request filter. If you’re using pretty permalinks, pagename will be set, you can overwrite pagename with another page slug: function wpd_265903_request( $request ) { if( isset( $request[‘pagename’] ) ){ // any page $request[‘pagename’] = ‘some-other-slug’; } return $request; } add_filter(‘request’, ‘wpd_265903_request’); or you … Read more

How can I output all apply_filters and do_action?

apply_filters and do_action are NOT stored in $wp_filter, ONLY add_filter and add_action are stored in $wp_filter When you call apply_filters or do_action, core WordPress loops through all of the registered filters or actions (added by add_filter and add_action), looking for any matching ones, and then executes the associated function. The only difference being actions which … Read more