Changeset 58275 for trunk/src/wp-includes/blocks/navigation.php
- Timestamp:
- 05/31/2024 06:34:20 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks/navigation.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/navigation.php
r58187 r58275 1618 1618 1619 1619 /* 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 */ 1625 if ( 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 ) { 1624 1630 add_filter( 'rest_pre_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta' ); 1625 1631 } … … 1669 1675 1670 1676 /* 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 */ 1682 if ( 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 ) { 1675 1687 add_filter( 'rest_prepare_wp_navigation', 'block_core_navigation_insert_hooked_blocks_into_rest_response', 10, 3 ); 1676 1688 }
Note: See TracChangeset
for help on using the changeset viewer.