Make WordPress Core


Ignore:
Timestamp:
09/26/2023 02:20:18 PM (2 years ago)
Author:
karmatosed
Message:

Update editor related npm packages

The npm packages needed updating for 6.4 to the latest.

Props mikachan, mukesdpanchal27, luisherranz, youknowriad, tellthemachines, gziolo, ockham, michalczaplinski

Fixes #59411

File:
1 edited

Legend:

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

    r56298 r56710  
    4242
    4343    $pattern = $registry->get_registered( $slug );
    44     return do_blocks( $pattern['content'] );
     44    $content = $pattern['content'];
     45
     46    // Backward compatibility for handling Block Hooks and injecting the theme attribute in the Gutenberg plugin.
     47    // This can be removed when the minimum supported WordPress is >= 6.4.
     48    if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && ! function_exists( 'traverse_and_serialize_blocks' ) ) {
     49        $content = _inject_theme_attribute_in_block_template_content( $content );
     50        $blocks  = parse_blocks( $content );
     51        $content = gutenberg_serialize_blocks( $blocks );
     52    }
     53
     54    return do_blocks( $content );
    4555}
    4656
Note: See TracChangeset for help on using the changeset viewer.