Make WordPress Core


Ignore:
Timestamp:
05/31/2024 06:34:20 PM (2 years ago)
Author:
ellatrix
Message:

Editor: Update npm packages.

Updates the editor npm packages to latest versions.

Props vcanales.

Fixes #61339.

File:
1 edited

Legend:

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

    r58187 r58275  
    16181618
    16191619/*
    1620  * Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.5
    1621  * that are not present in Gutenberg's WP 6.5 compatibility layer.
    1622  */
    1623 if ( function_exists( 'set_ignored_hooked_blocks_metadata' ) && ! has_filter( 'rest_pre_insert_wp_navigation', $rest_insert_wp_navigation_core_callback ) ) {
     1620 * Do not add the `block_core_navigation_update_ignore_hooked_blocks_meta` filter in the following cases:
     1621 * - If Core has added the `update_ignored_hooked_blocks_postmeta` filter already (WP >= 6.6);
     1622 * - or if the `set_ignored_hooked_blocks_metadata` function is unavailable (which is required for the filter to work. It was introduced by WP 6.5 but is not present in Gutenberg's WP 6.5 compatibility layer);
     1623 * - or if the `$rest_insert_wp_navigation_core_callback` filter has already been added.
     1624 */
     1625if (
     1626    ! has_filter( 'rest_pre_insert_wp_navigation', 'update_ignored_hooked_blocks_postmeta' ) &&
     1627    function_exists( 'set_ignored_hooked_blocks_metadata' ) &&
     1628    ! has_filter( 'rest_pre_insert_wp_navigation', $rest_insert_wp_navigation_core_callback )
     1629) {
    16241630    add_filter( 'rest_pre_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta' );
    16251631}
     
    16691675
    16701676/*
    1671  * Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.5
    1672  * that are not present in Gutenberg's WP 6.5 compatibility layer.
    1673  */
    1674 if ( function_exists( 'set_ignored_hooked_blocks_metadata' ) && ! has_filter( 'rest_prepare_wp_navigation', $rest_prepare_wp_navigation_core_callback ) ) {
     1677 * Do not add the `block_core_navigation_insert_hooked_blocks_into_rest_response` filter in the following cases:
     1678 * - If Core has added the `insert_hooked_blocks_into_rest_response` filter already (WP >= 6.6);
     1679 * - or if the `set_ignored_hooked_blocks_metadata` function is unavailable (which is required for the filter to work. It was introduced by WP 6.5 but is not present in Gutenberg's WP 6.5 compatibility layer);
     1680 * - or if the `$rest_prepare_wp_navigation_core_callback` filter has already been added.
     1681 */
     1682if (
     1683    ! has_filter( 'rest_prepare_wp_navigation', 'insert_hooked_blocks_into_rest_response' ) &&
     1684    function_exists( 'set_ignored_hooked_blocks_metadata' ) &&
     1685    ! has_filter( 'rest_prepare_wp_navigation', $rest_prepare_wp_navigation_core_callback )
     1686) {
    16751687    add_filter( 'rest_prepare_wp_navigation', 'block_core_navigation_insert_hooked_blocks_into_rest_response', 10, 3 );
    16761688}
Note: See TracChangeset for help on using the changeset viewer.