Custom time range for the posts_where filter

You can set your own custom query vars in a query, then use that value to set a class variable that you later read in the filter: class WPA69844_where { var $days; public function __construct(){ add_action( ‘parse_query’, array( $this, ‘parse_query’ ) ); } public function parse_query( $query ) { if( isset( $query->query_vars[‘my_days_var’] ) ): $this->days … Read more