wordpress $wp_query where is set

wordpress $wp_query Где устанавливается (напр. для not found 404)

Для wordpress 5 трассировка вызова:

#0  ptrace() called at [/wp-includes/class-wp-query.php:1571]
#1  WP_Query->set_404() called at [/wp-includes/class-wp.php:697]
#2  WP->handle_404() called at [/wp-includes/class-wp.php:718]
#3  WP->main() called at [/wp-includes/functions.php:964]
#4  wp() called at [/wp-blog-header.php:16]
#5  require(wp-blog-header.php) called at [/var/www/zaharochek/index.php:20]

Трасса из файла wp-includes/class-wp-query.php метод:

Subscribe to RSS - wordpress $wp_query where is set