Skip to content

Commit

Permalink
Editor: Update Packages with the latest bug fixes for 6.5 RC 1
Browse files Browse the repository at this point in the history
It includes all the backports from this Gutenberg PR WordPress/gutenberg#59541

Props get_dave, youknowriad, talldanwp.
See #60315.
Fixes #60665.
Built from https://develop.svn.wordpress.org/trunk@57760


git-svn-id: https://core.svn.wordpress.org/trunk@57261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
youknowriad committed Mar 4, 2024
1 parent 437f6bd commit a774429
Show file tree
Hide file tree
Showing 95 changed files with 920 additions and 478 deletions.
2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.min.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.php

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions wp-includes/block-bindings/pattern-overrides.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
* @return mixed The value computed for the source.
*/
function _block_bindings_pattern_overrides_get_value( array $source_args, $block_instance, string $attribute_name ) {
if ( empty( $block_instance->attributes['metadata']['id'] ) ) {
if ( empty( $block_instance->attributes['metadata']['name'] ) ) {
return null;
}
$block_id = $block_instance->attributes['metadata']['id'];
return _wp_array_get( $block_instance->context, array( 'pattern/overrides', $block_id, 'values', $attribute_name ), null );
$metadata_name = $block_instance->attributes['metadata']['name'];
return _wp_array_get( $block_instance->context, array( 'pattern/overrides', $metadata_name, $attribute_name ), null );
}

/**
Expand Down
33 changes: 21 additions & 12 deletions wp-includes/blocks/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,35 @@ function render_block_core_block( $attributes ) {
$content = $wp_embed->run_shortcode( $reusable_block->post_content );
$content = $wp_embed->autoembed( $content );

// Back compat, the content attribute was previously named overrides and
// had a slightly different format. For blocks that have not been migrated,
// also convert the format here so that the provided `pattern/overrides`
// context is correct.
if ( isset( $attributes['overrides'] ) && ! isset( $attributes['content'] ) ) {
$migrated_content = array();
foreach ( $attributes['overrides'] as $id => $values ) {
$migrated_content[ $id ] = array(
'values' => $values,
);
// Back compat.
// For blocks that have not been migrated in the editor, add some back compat
// so that front-end rendering continues to work.

// This matches the `v2` deprecation. Removes the inner `values` property
// from every item.
if ( isset( $attributes['content'] ) ) {
foreach ( $attributes['content'] as &$content_data ) {
if ( isset( $content_data['values'] ) ) {
$is_assoc_array = is_array( $content_data['values'] ) && ! wp_is_numeric_array( $content_data['values'] );

if ( $is_assoc_array ) {
$content_data = $content_data['values'];
}
}
}
$attributes['content'] = $migrated_content;
}
$has_pattern_overrides = isset( $attributes['content'] );

// This matches the `v1` deprecation. Rename `overrides` to `content`.
if ( isset( $attributes['overrides'] ) && ! isset( $attributes['content'] ) ) {
$attributes['content'] = $attributes['overrides'];
}

/**
* We set the `pattern/overrides` context through the `render_block_context`
* filter so that it is available when a pattern's inner blocks are
* rendering via do_blocks given it only receives the inner content.
*/
$has_pattern_overrides = isset( $attributes['content'] );
if ( $has_pattern_overrides ) {
$filter_block_context = static function ( $context ) use ( $attributes ) {
$context['pattern/overrides'] = $attributes['content'];
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/blocks/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ private static function get_nav_element_directives( $is_interactive ) {
return '';
}
// When adding to this array be mindful of security concerns.
$nav_element_context = data_wp_context(
$nav_element_context = wp_interactivity_data_wp_context(
array(
'overlayOpenedBy' => array(
'click' => false,
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/blocks/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function render_block_core_search( $attributes ) {
if ( $is_expandable_searchfield ) {
$aria_label_expanded = __( 'Submit Search' );
$aria_label_collapsed = __( 'Expand search field' );
$form_context = data_wp_context(
$form_context = wp_interactivity_data_wp_context(
array(
'isSearchInputVisible' => $open_by_default,
'inputId' => $input_id,
Expand Down
1 change: 1 addition & 0 deletions wp-includes/css/dist/block-directory/style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
--wp-admin-border-width-focus:2px;
--wp-block-synced-color:#7a00df;
--wp-block-synced-color--rgb:122, 0, 223;
--wp-bound-block-color:#9747ff;
}
@media (min-resolution:192dpi){
:root{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-directory/style-rtl.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wp-includes/css/dist/block-directory/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
--wp-admin-border-width-focus:2px;
--wp-block-synced-color:#7a00df;
--wp-block-synced-color--rgb:122, 0, 223;
--wp-bound-block-color:#9747ff;
}
@media (min-resolution:192dpi){
:root{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-directory/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wp-includes/css/dist/block-editor/content-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
--wp-admin-border-width-focus:2px;
--wp-block-synced-color:#7a00df;
--wp-block-synced-color--rgb:122, 0, 223;
--wp-bound-block-color:#9747ff;
}
@media (min-resolution:192dpi){
:root{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-editor/content-rtl.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions wp-includes/css/dist/block-editor/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
--wp-admin-border-width-focus:2px;
--wp-block-synced-color:#7a00df;
--wp-block-synced-color--rgb:122, 0, 223;
--wp-bound-block-color:#9747ff;
}
@media (min-resolution:192dpi){
:root{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-editor/content.min.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
--wp-admin-border-width-focus:2px;
--wp-block-synced-color:#7a00df;
--wp-block-synced-color--rgb:122, 0, 223;
--wp-bound-block-color:#9747ff;
}
@media (min-resolution:192dpi){
:root{
Expand Down
Loading

0 comments on commit a774429

Please sign in to comment.