diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-includes/blocks/query-no-results.php --- a/wp/wp-includes/blocks/query-no-results.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-includes/blocks/query-no-results.php Fri Sep 05 18:40:08 2025 +0200 @@ -8,6 +8,10 @@ /** * Renders the `core/query-no-results` block on the server. * + * @since 6.0.0 + * + * @global WP_Query $wp_query WordPress Query object. + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -32,23 +36,23 @@ $query = new WP_Query( $query_args ); } - if ( $query->have_posts() ) { + if ( $query->post_count > 0 ) { return ''; } - if ( ! $use_global_query ) { - wp_reset_postdata(); - } - + $classes = ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) ? 'has-link-color' : ''; + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); return sprintf( '