You appear to be a bot. Output may be restricted
Description
Implement "posts_request" filter to intercept the main query
In http://wordpress.stackexchange.com/questions/98326/disable-the-mysql-query-in-the-main-query there are a number of recommendations…. just return nothing in the $request or handle 'posts_where' and set 'AND 1=0' to cause the SQL to return nothing In this case we're looking for a query_var of "oik-plugin" which will be set when the request is /plugins/update-check Can we also check for the "oik-banner" query_var and achieve the same thing? Can we remove the filter for ANY invocation, or only when it's the main query or when we've decided to intercept the query. What does that mean when WooCommerce is doing its nasty stuff with webhooks?
Usage
oikp_posts_request( $request, $query );
Parameters
- $request
- ( mixed ) required –
- $query
- ( mixed ) required –
Returns
void
Source
File name: oik-plugins/oik-plugins.php
Lines:
function oikp_posts_request( $request, $query ) { $oik_plugin = get_query_var( "oik-plugin" ); if ( $oik_plugin ) { //bw_trace2(); //bw_backtrace(); //oikp_template_redirect(); $request = null; } else { $oik_banner = get_query_var( "oik-banner" ); if ( $oik_banner ) { $request = null; } } if ( !$request ) { remove_filter( "posts_request", "oikp_posts_request" ); } return( $request ); }