Fires after the query variable object is created, but before the actual query is run.
Description
Note: If using conditional tags, use the method versions within the passed instance (e.g. $this->is_main_query() instead of is_main_query()). This is because the functions like is_main_query() test against the global $wp_query instance, not the passed one.
1875* like is_main_query() test against the global$wp_query instance, not the passed one.1876*1877* @since 2.0.01878*1879* @param WP_Query$query The WP_Query instance(passed by reference).1880*/1881do_action_ref_array('pre_get_posts',array(&$this));18821883// Shorthand.1884$q=&$this->query_vars;18851886// Fill again in case 'pre_get_posts' unset some vars.1887$q=$this->fill_query_vars($q);
History
Introduced in 2.0.0. Unchanged from 6.7.7 through 7.1.0.