wpseek.com
A WordPress-centric search engine for devs and theme authors
block_core_navigation_mock_parsed_block › WordPress Function
Since6.5.0
Deprecatedn/a
› block_core_navigation_mock_parsed_block ( $inner_blocks, $post )
Parameters: (2) |
|
Returns: |
|
Defined at: |
|
Codex: |
Mock a parsed block for the Navigation block given its inner blocks and the `wp_navigation` post object.
Thewp_navigation
post's _wp_ignored_hooked_blocks
meta is queried to add the metadata.ignoredHookedBlocks
attribute.Source
function block_core_navigation_mock_parsed_block( $inner_blocks, $post ) { $attributes = array(); if ( isset( $post->ID ) ) { $ignored_hooked_blocks = get_post_meta( $post->ID, '_wp_ignored_hooked_blocks', true ); if ( ! empty( $ignored_hooked_blocks ) ) { $ignored_hooked_blocks = json_decode( $ignored_hooked_blocks, true ); $attributes['metadata'] = array( 'ignoredHookedBlocks' => $ignored_hooked_blocks, ); } } $mock_anchor_parent_block = array( 'blockName' => 'core/navigation', 'attrs' => $attributes, 'innerBlocks' => $inner_blocks, 'innerContent' => array_fill( 0, count( $inner_blocks ), null ), ); return $mock_anchor_parent_block; }