Make WordPress Core


Ignore:
Timestamp:
08/23/2022 03:40:25 PM (4 years ago)
Author:
gziolo
Message:

Editor: Backport bug fixes from Gutenberg into Core for WP 6.0.2 RC

This brings a new version of the Gutenberg code from the wp/6.0 branch into core.

  • @wordpress/block-directory@3.4.14
    • @wordpress/block-editor@8.5.10
    • @wordpress/block-library@7.3.14
    • @wordpress/customize-widgets@3.3.14
    • @wordpress/edit-post@6.3.14
    • @wordpress/edit-site@4.3.14
    • @wordpress/edit-widgets@4.3.14
    • @wordpress/editor@12.5.10
    • @wordpress/format-library@3.4.10
    • @wordpress/reusable-blocks@3.4.10
    • @wordpress/widgets@2.4.10

Props SergeyBiryukov.
Fixes #56414.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/query-no-results.php

    r53157 r53929  
    2020        }
    2121
    22         $page_key   = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
    23         $page       = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
    24         $query_args = build_query_vars_from_query_block( $block, $page );
     22        $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
     23        $page     = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
     24
    2525        // Override the custom query with the global query if needed.
    2626        $use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] );
    2727        if ( $use_global_query ) {
    2828                global $wp_query;
    29                 if ( $wp_query && isset( $wp_query->query_vars ) && is_array( $wp_query->query_vars ) ) {
    30                         $query_args = wp_parse_args( $wp_query->query_vars, $query_args );
    31                 }
     29                $query = $wp_query;
     30        } else {
     31                $query_args = build_query_vars_from_query_block( $block, $page );
     32                $query      = new WP_Query( $query_args );
    3233        }
    33         $query = new WP_Query( $query_args );
    3434
    3535        if ( $query->have_posts() ) {
     
    3737        }
    3838
    39         wp_reset_postdata();
     39        if ( ! $use_global_query ) {
     40                wp_reset_postdata();
     41        }
    4042
    4143        return sprintf(
Note: See TracChangeset for help on using the changeset viewer.