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 [https://github.com/WordPress/gutenberg/tree/wp/6.0 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 gziolo, SergeyBiryukov.
Merges [53929] to the 6.0 branch.
Fixes .

git-svn-id: https://develop.svn.wordpress.org/branches/6.0@53930 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2022-08-23 15:52:08 +00:00
parent 52b1a515d6
commit 3afe021c2d
5 changed files with 1299 additions and 1080 deletions

2314
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -81,28 +81,28 @@
"@wordpress/api-fetch": "6.3.1",
"@wordpress/autop": "3.6.1",
"@wordpress/blob": "3.6.1",
"@wordpress/block-directory": "3.4.13",
"@wordpress/block-editor": "8.5.9",
"@wordpress/block-library": "7.3.13",
"@wordpress/block-directory": "3.4.14",
"@wordpress/block-editor": "8.5.10",
"@wordpress/block-library": "7.3.14",
"@wordpress/block-serialization-default-parser": "4.6.1",
"@wordpress/blocks": "11.5.3",
"@wordpress/components": "19.8.5",
"@wordpress/compose": "5.4.1",
"@wordpress/core-data": "4.4.5",
"@wordpress/customize-widgets": "3.3.13",
"@wordpress/customize-widgets": "3.3.14",
"@wordpress/data": "6.6.1",
"@wordpress/data-controls": "2.6.1",
"@wordpress/date": "4.6.1",
"@wordpress/deprecated": "3.6.1",
"@wordpress/dom": "3.6.1",
"@wordpress/dom-ready": "3.6.1",
"@wordpress/edit-post": "6.3.13",
"@wordpress/edit-site": "4.3.13",
"@wordpress/edit-widgets": "4.3.13",
"@wordpress/editor": "12.5.9",
"@wordpress/edit-post": "6.3.14",
"@wordpress/edit-site": "4.3.14",
"@wordpress/edit-widgets": "4.3.14",
"@wordpress/editor": "12.5.10",
"@wordpress/element": "4.4.1",
"@wordpress/escape-html": "2.6.1",
"@wordpress/format-library": "3.4.9",
"@wordpress/format-library": "3.4.10",
"@wordpress/hooks": "3.6.1",
"@wordpress/html-entities": "3.6.1",
"@wordpress/i18n": "4.6.1",
@ -120,7 +120,7 @@
"@wordpress/primitives": "3.4.1",
"@wordpress/priority-queue": "2.6.1",
"@wordpress/redux-routine": "4.6.1",
"@wordpress/reusable-blocks": "3.4.9",
"@wordpress/reusable-blocks": "3.4.10",
"@wordpress/rich-text": "5.4.2",
"@wordpress/server-side-render": "3.4.6",
"@wordpress/shortcode": "3.6.1",
@ -129,7 +129,7 @@
"@wordpress/url": "3.7.1",
"@wordpress/viewport": "4.4.1",
"@wordpress/warning": "2.6.1",
"@wordpress/widgets": "2.4.9",
"@wordpress/widgets": "2.4.10",
"@wordpress/wordcount": "3.6.1",
"backbone": "1.4.1",
"clipboard": "2.0.10",

File diff suppressed because one or more lines are too long

@ -44,24 +44,16 @@ function render_block_core_post_template( $attributes, $content, $block ) {
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
$query_args = build_query_vars_from_query_block( $block, $page );
// Override the custom query with the global query if needed.
// Use global query if needed.
$use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] );
if ( $use_global_query ) {
global $wp_query;
if ( $wp_query && isset( $wp_query->query_vars ) && is_array( $wp_query->query_vars ) ) {
// Unset `offset` because if is set, $wp_query overrides/ignores the paged parameter and breaks pagination.
unset( $query_args['offset'] );
$query_args = wp_parse_args( $wp_query->query_vars, $query_args );
if ( empty( $query_args['post_type'] ) && is_singular() ) {
$query_args['post_type'] = get_post_type( get_the_ID() );
}
}
$query = clone $wp_query;
} else {
$query_args = build_query_vars_from_query_block( $block, $page );
$query = new WP_Query( $query_args );
}
$query = new WP_Query( $query_args );
if ( ! $query->have_posts() ) {
return '';
}
@ -107,6 +99,11 @@ function render_block_core_post_template( $attributes, $content, $block ) {
$content .= '<li class="' . esc_attr( $post_classes ) . '">' . $block_content . '</li>';
}
/*
* Use this function to restore the context of the template tags
* from a secondary query loop back to the main query loop.
* Since we use two custom loops, it's safest to always restore.
*/
wp_reset_postdata();
return sprintf(

@ -19,24 +19,26 @@ function render_block_core_query_no_results( $attributes, $content, $block ) {
return '';
}
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
$query_args = build_query_vars_from_query_block( $block, $page );
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
// Override the custom query with the global query if needed.
$use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] );
if ( $use_global_query ) {
global $wp_query;
if ( $wp_query && isset( $wp_query->query_vars ) && is_array( $wp_query->query_vars ) ) {
$query_args = wp_parse_args( $wp_query->query_vars, $query_args );
}
$query = $wp_query;
} else {
$query_args = build_query_vars_from_query_block( $block, $page );
$query = new WP_Query( $query_args );
}
$query = new WP_Query( $query_args );
if ( $query->have_posts() ) {
return '';
}
wp_reset_postdata();
if ( ! $use_global_query ) {
wp_reset_postdata();
}
return sprintf(
'<div %1$s>%2$s</div>',