Make WordPress Core


Ignore:
Timestamp:
01/31/2024 11:54:09 AM (9 months ago)
Author:
youknowriad
Message:

Editor: Update WordPress packages to Gutenberg 16.7 RC3.

It brings with a set of iterations and follow-ups to the initial package update.
It also fixes a regression that happened for interactive blocks.

Props gziolo, luisherranz, cbravobernal.
See #60315.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/navigation.php

    r57377 r57499  
    193193            $blocks = block_core_navigation_filter_out_empty_blocks( $parsed_blocks );
    194194
    195             if ( function_exists( 'get_hooked_blocks' ) ) {
     195            if ( function_exists( 'get_hooked_block_markup' ) ) {
    196196                // Run Block Hooks algorithm to inject hooked blocks.
    197197                $markup         = block_core_navigation_insert_hooked_blocks( $blocks, $navigation_post );
     
    993993        $fallback_blocks = ! empty( $maybe_fallback ) ? $maybe_fallback : $fallback_blocks;
    994994
    995         if ( function_exists( 'get_hooked_blocks' ) ) {
     995        if ( function_exists( 'get_hooked_block_markup' ) ) {
    996996            // Run Block Hooks algorithm to inject hooked blocks.
    997997            // We have to run it here because we need the post ID of the Navigation block to track ignored hooked blocks.
     
    13591359 * @return string Serialized inner blocks in mock Navigation block wrapper, with hooked blocks inserted, if any.
    13601360 */
    1361 function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post = null ) {
     1361function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post ) {
    13621362    $before_block_visitor = null;
    13631363    $after_block_visitor  = null;
     
    13981398 */
    13991399function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
    1400     if ( ! isset( $post->ID ) ) {
    1401         return;
    1402     }
    1403 
    14041400    // We run the Block Hooks mechanism so it will return the list of ignored hooked blocks
    14051401    // in the mock root Navigation block's metadata attribute.
     
    14231419}
    14241420
    1425 // Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.4
    1426 // that are not present in Gutenberg's WP 6.4 compatibility layer.
    1427 if ( function_exists( 'get_hooked_blocks' ) ) {
     1421// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.5
     1422// that are not present in Gutenberg's WP 6.5 compatibility layer.
     1423if ( function_exists( 'get_hooked_block_markup' ) ) {
    14281424    add_action( 'rest_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta', 10, 3 );
    14291425}
     
    14551451}
    14561452
    1457 // Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.4
    1458 // that are not present in Gutenberg's WP 6.4 compatibility layer.
    1459 if ( function_exists( 'get_hooked_blocks' ) ) {
     1453// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.5
     1454// that are not present in Gutenberg's WP 6.5 compatibility layer.
     1455if ( function_exists( 'get_hooked_block_markup' ) ) {
    14601456    add_filter( 'rest_prepare_wp_navigation', 'block_core_navigation_insert_hooked_blocks_into_rest_response', 10, 3 );
    14611457}
Note: See TracChangeset for help on using the changeset viewer.