I wanna know how
do_action( ‘template_redirect’ ); is filling up [queried_object] => WP_Term Object
(
[term_id] => 43
[name] => media
[slug] => media
[term_group] => 0
[term_taxonomy_id] => 42
[taxonomy] => category
[description] =>
[parent] => 0
[count] => 0
[filter] => raw
[cat_ID] => 43
[category_count] => 0
[category_description] =>
[cat_name] => media
[category_nicename] => media
[category_parent] => 0
) in global $wp_the_query
if ( wp_using_themes() ) {
/**
* Fires before determining which template to load.
*
* @since 1.5.0
*/
echo "checking global before in template_redirect";
global $wp_the_query;
print_r($wp_the_query);
echo "checking global before in template_redirect";
do_action( 'template_redirect' );
echo "checking global after template_redirect ";
print_r($wp_the_query);
echo "checking global after template_redirect ";
}
I printed the query one before and one after the do_action( ‘template_redirect’ );. removing do_action( ‘template_redirect’ ); empties $wp_the_query->queried_object