This action hook is executed prior to the query, and is passed a string containing the assembled query. Note that this string is NOT passed by reference and manipulating this string will not affect the actual query. This is intended to be used primarily by caching plugins.
add_action( 'posts_selection', 'check_assembled_query' ); function check_assembled_query( $query ) { var_dump( $query ); }
The 'posts_selection' hook is found in /wp-includes/query.php
, within the get_posts() method of the WP_Query() class.