Changeset 57499 for trunk/src/wp-includes/blocks/navigation.php
- Timestamp:
- 01/31/2024 11:54:09 AM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/navigation.php
r57377 r57499 193 193 $blocks = block_core_navigation_filter_out_empty_blocks( $parsed_blocks ); 194 194 195 if ( function_exists( 'get_hooked_block s' ) ) {195 if ( function_exists( 'get_hooked_block_markup' ) ) { 196 196 // Run Block Hooks algorithm to inject hooked blocks. 197 197 $markup = block_core_navigation_insert_hooked_blocks( $blocks, $navigation_post ); … … 993 993 $fallback_blocks = ! empty( $maybe_fallback ) ? $maybe_fallback : $fallback_blocks; 994 994 995 if ( function_exists( 'get_hooked_block s' ) ) {995 if ( function_exists( 'get_hooked_block_markup' ) ) { 996 996 // Run Block Hooks algorithm to inject hooked blocks. 997 997 // We have to run it here because we need the post ID of the Navigation block to track ignored hooked blocks. … … 1359 1359 * @return string Serialized inner blocks in mock Navigation block wrapper, with hooked blocks inserted, if any. 1360 1360 */ 1361 function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post = null) {1361 function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post ) { 1362 1362 $before_block_visitor = null; 1363 1363 $after_block_visitor = null; … … 1398 1398 */ 1399 1399 function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) { 1400 if ( ! isset( $post->ID ) ) {1401 return;1402 }1403 1404 1400 // We run the Block Hooks mechanism so it will return the list of ignored hooked blocks 1405 1401 // in the mock root Navigation block's metadata attribute. … … 1423 1419 } 1424 1420 1425 // Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6. 41426 // that are not present in Gutenberg's WP 6. 4compatibility layer.1427 if ( function_exists( 'get_hooked_block s' ) ) {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. 1423 if ( function_exists( 'get_hooked_block_markup' ) ) { 1428 1424 add_action( 'rest_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta', 10, 3 ); 1429 1425 } … … 1455 1451 } 1456 1452 1457 // Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6. 41458 // that are not present in Gutenberg's WP 6. 4compatibility layer.1459 if ( function_exists( 'get_hooked_block s' ) ) {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. 1455 if ( function_exists( 'get_hooked_block_markup' ) ) { 1460 1456 add_filter( 'rest_prepare_wp_navigation', 'block_core_navigation_insert_hooked_blocks_into_rest_response', 10, 3 ); 1461 1457 }
Note: See TracChangeset
for help on using the changeset viewer.