Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/trunk' into html-api/test-mino…
Browse files Browse the repository at this point in the history
…r-cleanup
  • Loading branch information
dmsnell committed Feb 1, 2024
2 parents 7cd5331 + cdb218b commit ddbd457
Show file tree
Hide file tree
Showing 26 changed files with 487 additions and 369 deletions.
438 changes: 219 additions & 219 deletions package-lock.json

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,37 +85,37 @@
"@wordpress/api-fetch": "6.47.0",
"@wordpress/autop": "3.50.0",
"@wordpress/blob": "3.50.0",
"@wordpress/block-directory": "4.27.1",
"@wordpress/block-editor": "12.18.1",
"@wordpress/block-library": "8.27.1",
"@wordpress/block-directory": "4.27.2",
"@wordpress/block-editor": "12.18.2",
"@wordpress/block-library": "8.27.2",
"@wordpress/block-serialization-default-parser": "4.50.0",
"@wordpress/blocks": "12.27.1",
"@wordpress/commands": "0.21.0",
"@wordpress/components": "25.16.0",
"@wordpress/compose": "6.27.0",
"@wordpress/core-commands": "0.19.1",
"@wordpress/core-data": "6.27.1",
"@wordpress/customize-widgets": "4.27.1",
"@wordpress/core-commands": "0.19.2",
"@wordpress/core-data": "6.27.2",
"@wordpress/customize-widgets": "4.27.2",
"@wordpress/data": "9.20.0",
"@wordpress/data-controls": "3.19.0",
"@wordpress/dataviews": "0.4.0",
"@wordpress/dataviews": "0.4.1",
"@wordpress/date": "4.50.0",
"@wordpress/deprecated": "3.50.0",
"@wordpress/dom": "3.50.0",
"@wordpress/dom-ready": "3.50.0",
"@wordpress/edit-post": "7.27.1",
"@wordpress/edit-site": "5.27.1",
"@wordpress/edit-widgets": "5.27.1",
"@wordpress/editor": "13.27.1",
"@wordpress/edit-post": "7.27.2",
"@wordpress/edit-site": "5.27.2",
"@wordpress/edit-widgets": "5.27.2",
"@wordpress/editor": "13.27.2",
"@wordpress/element": "5.27.0",
"@wordpress/escape-html": "2.50.0",
"@wordpress/format-library": "4.27.1",
"@wordpress/format-library": "4.27.2",
"@wordpress/hooks": "3.50.0",
"@wordpress/html-entities": "3.50.0",
"@wordpress/i18n": "4.50.0",
"@wordpress/icons": "9.41.0",
"@wordpress/interactivity": "4.0.0",
"@wordpress/interactivity-router": "1.0.0",
"@wordpress/interactivity": "4.0.1",
"@wordpress/interactivity-router": "1.0.1",
"@wordpress/interface": "5.27.0",
"@wordpress/is-shallow-equal": "4.50.0",
"@wordpress/keyboard-shortcuts": "4.27.0",
Expand All @@ -124,15 +124,15 @@
"@wordpress/media-utils": "4.41.0",
"@wordpress/notices": "4.18.0",
"@wordpress/nux": "8.12.0",
"@wordpress/patterns": "1.11.1",
"@wordpress/patterns": "1.11.2",
"@wordpress/plugins": "6.18.0",
"@wordpress/preferences": "3.27.0",
"@wordpress/preferences-persistence": "1.42.0",
"@wordpress/primitives": "3.48.0",
"@wordpress/priority-queue": "2.50.0",
"@wordpress/private-apis": "0.32.0",
"@wordpress/redux-routine": "4.50.0",
"@wordpress/reusable-blocks": "4.27.1",
"@wordpress/reusable-blocks": "4.27.2",
"@wordpress/rich-text": "6.27.0",
"@wordpress/router": "0.19.0",
"@wordpress/server-side-render": "4.27.1",
Expand All @@ -144,7 +144,7 @@
"@wordpress/url": "3.51.0",
"@wordpress/viewport": "5.27.0",
"@wordpress/warning": "2.50.0",
"@wordpress/widgets": "3.27.1",
"@wordpress/widgets": "3.27.2",
"@wordpress/wordcount": "3.50.0",
"backbone": "1.5.0",
"clipboard": "2.0.11",
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentytwentythree/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@
{
"area": "uncategorized",
"name": "comments",
"title": "Comments"
"title": "Comments Template Part"
},
{
"area": "uncategorized",
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/assets/script-loader-packages.min.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/wp-includes/block-bindings.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function register_block_bindings_source( $source_name, array $source_properties
* @since 6.5.0
*
* @param string $source_name Block bindings source name including namespace.
* @return array|false The unregistred block bindings source on success and `false` otherwise.
* @return array|false The unregistered block bindings source on success and `false` otherwise.
*/
function unregister_block_bindings_source( $source_name ) {
return WP_Block_Bindings_Registry::get_instance()->unregister( $source_name );
Expand Down
1 change: 0 additions & 1 deletion src/wp-includes/blocks/blocks-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -2073,7 +2073,6 @@
)
),
'dimensions' => array(
'aspectRatio' => true,
'minHeight' => true
),
'__experimentalBorder' => array(
Expand Down
1 change: 0 additions & 1 deletion src/wp-includes/blocks/group/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
}
},
"dimensions": {
"aspectRatio": true,
"minHeight": true
},
"__experimentalBorder": {
Expand Down
22 changes: 9 additions & 13 deletions src/wp-includes/blocks/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private static function get_inner_blocks_from_navigation_post( $attributes ) {
// it encounters whitespace. This code strips it.
$blocks = block_core_navigation_filter_out_empty_blocks( $parsed_blocks );

if ( function_exists( 'get_hooked_blocks' ) ) {
if ( function_exists( 'get_hooked_block_markup' ) ) {
// Run Block Hooks algorithm to inject hooked blocks.
$markup = block_core_navigation_insert_hooked_blocks( $blocks, $navigation_post );
$root_nav_block = parse_blocks( $markup )[0];
Expand Down Expand Up @@ -992,7 +992,7 @@ function block_core_navigation_get_fallback_blocks() {
// In this case default to the (Page List) fallback.
$fallback_blocks = ! empty( $maybe_fallback ) ? $maybe_fallback : $fallback_blocks;

if ( function_exists( 'get_hooked_blocks' ) ) {
if ( function_exists( 'get_hooked_block_markup' ) ) {
// Run Block Hooks algorithm to inject hooked blocks.
// We have to run it here because we need the post ID of the Navigation block to track ignored hooked blocks.
$markup = block_core_navigation_insert_hooked_blocks( $fallback_blocks, $navigation_post );
Expand Down Expand Up @@ -1358,7 +1358,7 @@ function block_core_navigation_get_most_recently_published_navigation() {
* @param WP_Post $post `wp_navigation` post object corresponding to the block.
* @return string Serialized inner blocks in mock Navigation block wrapper, with hooked blocks inserted, if any.
*/
function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post = null ) {
function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post ) {
$before_block_visitor = null;
$after_block_visitor = null;
$hooked_blocks = get_hooked_blocks();
Expand Down Expand Up @@ -1397,10 +1397,6 @@ function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post = null
* @param WP_Post $post Post object.
*/
function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
if ( ! isset( $post->ID ) ) {
return;
}

// We run the Block Hooks mechanism so it will return the list of ignored hooked blocks
// in the mock root Navigation block's metadata attribute.
// We ignore the rest of the returned `$markup`; `$post->post_content` already has the hooked
Expand All @@ -1422,9 +1418,9 @@ function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
}
}

// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.4
// that are not present in Gutenberg's WP 6.4 compatibility layer.
if ( function_exists( 'get_hooked_blocks' ) ) {
// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.5
// that are not present in Gutenberg's WP 6.5 compatibility layer.
if ( function_exists( 'get_hooked_block_markup' ) ) {
add_action( 'rest_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta', 10, 3 );
}

Expand Down Expand Up @@ -1454,8 +1450,8 @@ function block_core_navigation_insert_hooked_blocks_into_rest_response( $respons
return $response;
}

// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.4
// that are not present in Gutenberg's WP 6.4 compatibility layer.
if ( function_exists( 'get_hooked_blocks' ) ) {
// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.5
// that are not present in Gutenberg's WP 6.5 compatibility layer.
if ( function_exists( 'get_hooked_block_markup' ) ) {
add_filter( 'rest_prepare_wp_navigation', 'block_core_navigation_insert_hooked_blocks_into_rest_response', 10, 3 );
}
2 changes: 2 additions & 0 deletions src/wp-includes/blocks/pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ function register_block_core_pattern() {
*
* @since 6.3.0 Backwards compatibility: blocks with no `syncStatus` attribute do not receive block wrapper.
*
* @global WP_Embed $wp_embed Used to process embedded content within patterns
*
* @param array $attributes Block attributes.
*
* @return string Returns the output of the pattern.
Expand Down
6 changes: 3 additions & 3 deletions src/wp-includes/blocks/post-navigation-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
$in_same_term = isset( $attributes['inSameTerm'] ) ? $attributes['inSameTerm'] : false;
$taxonomy = isset( $attributes['taxonomy'] ) && $in_same_term ? $attributes['taxonomy'] : '';

/**
/*
* The dynamic portion of the function name, `$navigation_type`,
* Refers to the type of adjacency, 'next' or 'previous'.
*
* @See https://developer.wordpress.org/reference/functions/get_previous_post_link/
* @See https://developer.wordpress.org/reference/functions/get_next_post_link/
* @see https://developer.wordpress.org/reference/functions/get_previous_post_link/
* @see https://developer.wordpress.org/reference/functions/get_next_post_link/
*/
$get_link_function = "get_{$navigation_type}_post_link";

Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-block-bindings-registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function register( $source_name, array $source_properties ) {
* @since 6.5.0
*
* @param string $source_name Block bindings source name including namespace.
* @return array|false The unregistred block bindings source on success and `false` otherwise.
* @return array|false The unregistered block bindings source on success and `false` otherwise.
*/
public function unregister( $source_name ) {
if ( ! $this->is_registered( $source_name ) ) {
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/class-wp-http.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ static function ( $attr ) {
return null !== $attr;
}
);
$cookie_jar[ $value->name ] = new WpOrg\Requests\Cookie( $value->name, $value->value, $attributes, array( 'host-only' => $value->host_only ) );
$cookie_jar[ $value->name ] = new WpOrg\Requests\Cookie( (string) $value->name, $value->value, $attributes, array( 'host-only' => $value->host_only ) );
} elseif ( is_scalar( $value ) ) {
$cookie_jar[ $name ] = new WpOrg\Requests\Cookie( $name, (string) $value );
$cookie_jar[ $name ] = new WpOrg\Requests\Cookie( (string) $name, (string) $value );
}
}

Expand Down
15 changes: 13 additions & 2 deletions src/wp-includes/html-api/class-wp-html-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public function next_token() {
$found_a_token = parent::next_token();

if ( '#tag' === $this->get_token_type() ) {
$this->step( self::REPROCESS_CURRENT_NODE );
$this->step( self::PROCESS_CURRENT_NODE );
}

return $found_a_token;
Expand Down Expand Up @@ -513,7 +513,7 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ) {
return false;
}

if ( self::PROCESS_NEXT_NODE === $node_to_process ) {
if ( self::REPROCESS_CURRENT_NODE !== $node_to_process ) {
/*
* Void elements still hop onto the stack of open elements even though
* there's no corresponding closing tag. This is important for managing
Expand All @@ -532,7 +532,9 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ) {
if ( $top_node && self::is_void( $top_node->node_name ) ) {
$this->state->stack_of_open_elements->pop();
}
}

if ( self::PROCESS_NEXT_NODE === $node_to_process ) {
while ( parent::next_token() && '#tag' !== $this->get_token_type() ) {
continue;
}
Expand Down Expand Up @@ -1781,6 +1783,15 @@ public static function is_void( $tag_name ) {
*/
const REPROCESS_CURRENT_NODE = 'reprocess-current-node';

/**
* Indicates that the current HTML token should be processed without advancing the parser.
*
* @since 6.5.0
*
* @var string
*/
const PROCESS_CURRENT_NODE = 'process-current-node';

/**
* Indicates that the parser encountered unsupported markup and has bailed.
*
Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/html-api/class-wp-html-tag-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,8 @@ private function parse_next_tag() {
'T' === $html[ $this->token_starts_at + 6 ] &&
'A' === $html[ $this->token_starts_at + 7 ] &&
'[' === $html[ $this->token_starts_at + 8 ] &&
']' === $html[ $closer_at - 1 ]
']' === $html[ $closer_at - 1 ] &&
']' === $html[ $closer_at - 2 ]
) {
$this->parser_state = self::STATE_COMMENT;
$this->comment_type = self::COMMENT_AS_CDATA_LOOKALIKE;
Expand Down
26 changes: 26 additions & 0 deletions src/wp-includes/interactivity-api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Interactivity API: Functions and hooks
*
* @package WordPress
* @subpackage Interactivity API
*/

/**
* Registers the interactivity modules.
*/
function wp_interactivity_register_script_modules() {
wp_register_script_module(
'@wordpress/interactivity',
includes_url( '/js/dist/interactivity.min.js' ),
array()
);

wp_register_script_module(
'@wordpress/interactivity-router',
includes_url( '/js/dist/interactivity-router.min.js' ),
array( '@wordpress/interactivity' )
);
}

add_action( 'init', 'wp_interactivity_register_script_modules' );
19 changes: 1 addition & 18 deletions src/wp-includes/l10n/class-wp-translation-file.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,24 +203,7 @@ public function translate( string $text ) {
$this->parse_file();
}

if ( isset( $this->entries[ $text ] ) ) {
return $this->entries[ $text ];
}

/*
* Handle cases where a pluralized string is only used as a singular one.
* For example, when both __( 'Product' ) and _n( 'Product', 'Products' )
* are used, the entry key will have the format "ProductNULProducts".
* Fall back to looking up just "Product" to support this edge case.
*/
foreach ( $this->entries as $key => $value ) {
if ( str_starts_with( $key, $text . "\0" ) ) {
$parts = explode( "\0", $value );
return $parts[0];
}
}

return false;
return $this->entries[ $text ] ?? false;
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,11 @@ function wp_load_translations_early() {

// Translation and localization.
require_once ABSPATH . WPINC . '/pomo/mo.php';
require_once ABSPATH . WPINC . '/l10n/class-wp-translation-controller.php';
require_once ABSPATH . WPINC . '/l10n/class-wp-translations.php';
require_once ABSPATH . WPINC . '/l10n/class-wp-translation-file.php';
require_once ABSPATH . WPINC . '/l10n/class-wp-translation-file-mo.php';
require_once ABSPATH . WPINC . '/l10n/class-wp-translation-file-php.php';
require_once ABSPATH . WPINC . '/l10n.php';
require_once ABSPATH . WPINC . '/class-wp-textdomain-registry.php';
require_once ABSPATH . WPINC . '/class-wp-locale.php';
Expand Down
13 changes: 8 additions & 5 deletions src/wp-includes/script-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@
* This function provides access to the WP_Script_Modules instance, creating one
* if it doesn't exist yet.
*
* @global WP_Script_Modules $wp_script_modules
*
* @since 6.5.0
*
* @return WP_Script_Modules The main WP_Script_Modules instance.
*/
function wp_script_modules(): WP_Script_Modules {
static $instance = null;
if ( is_null( $instance ) ) {
$instance = new WP_Script_Modules();
$instance->add_hooks();
global $wp_script_modules;

if ( ! ( $wp_script_modules instanceof WP_Script_Modules ) ) {
$wp_script_modules = new WP_Script_Modules();
}
return $instance;

return $wp_script_modules;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@
require ABSPATH . WPINC . '/fonts.php';
require ABSPATH . WPINC . '/class-wp-script-modules.php';
require ABSPATH . WPINC . '/script-modules.php';
require ABSPATH . WPINC . '/interactivity-api.php';

wp_script_modules()->add_hooks();

$GLOBALS['wp_embed'] = new WP_Embed();

Expand Down
Loading

0 comments on commit ddbd457

Please sign in to comment.