I can’t find documentation regarding this – but is there a way to see how a query might bounce around from one filter to another? I’ve got a list of possible wp_filters and their relevance but I can’t determine what’s happening to a query I’m making.

Here’s the basics – I’m attempting to use the Relevanssi plugin with WooCommerce and the Vintage theme, searching through custom fields. I can see that the query is returning correctly before it’s being displayed; just before it’s displayed all the posts are removed.

1 Answer
1

Well you can try and run debug_backtrace(); on your function.

For example:

function wpse_82183_debug( $query ) {
    //your query goes here, this is just a basic one
    if ( $query->is_home() && $query->is_main_query() ) {
         $query->set( 'posts_per_page', 1 );

        //magic happens here
        var_dump(debug_backtrace());
    }
}
add_action( 'pre_get_posts', 'wpse_82183_debug' );

There are also a number of plugins that help figure stuff out,

I recently made this list: http://wycks.github.com/WordPress-Gear/ (click debug tools)

Have a look at :

  • http://wordpress.org/extend/plugins/wordpress-hook-sniffer/
  • http://wordpress.org/extend/plugins/debug-bar-template-trace/
  • http://wordpress.org/extend/plugins/debug-bar-action-hooks/

Leave a Reply

Your email address will not be published. Required fields are marked *