diff --git a/wp-includes/query.php b/wp-includes/query.php index b915119c35..7a210b09f1 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -901,6 +901,11 @@ function is_embed() { function is_main_query() { global $wp_query; + if ( ! isset( $wp_query ) ) { + _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '6.1.0' ); + return false; + } + if ( 'pre_get_posts' === current_filter() ) { _doing_it_wrong( __FUNCTION__, diff --git a/wp-includes/version.php b/wp-includes/version.php index 6037b8eb06..0948cfb966 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53394'; +$wp_version = '6.1-alpha-53395'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.