wpseek.com
WordPress开发者和主题制作者的搜索引擎
block_core_navigation_set_ignored_hooked_blocks_metadata › WordPress Function
Since6.5.0
已弃用n/a
› block_core_navigation_set_ignored_hooked_blocks_metadata ( $inner_blocks, $post )
参数: (2) |
|
返回: |
|
定义在: |
|
文档: |
Insert ignoredHookedBlocks meta into the Navigation block and its inner blocks.
Given a Navigation block's inner blocks and its correspondingwp_navigation
post object,
this function inserts ignoredHookedBlocks meta into it, and returns the serialized inner blocks in a
mock Navigation block wrapper.源码
function block_core_navigation_set_ignored_hooked_blocks_metadata( $inner_blocks, $post ) { $mock_navigation_block = block_core_navigation_mock_parsed_block( $inner_blocks, $post ); $hooked_blocks = get_hooked_blocks(); $before_block_visitor = null; $after_block_visitor = null; if ( ! empty( $hooked_blocks ) || has_filter( 'hooked_block_types' ) ) { $before_block_visitor = make_before_block_visitor( $hooked_blocks, $post, 'set_ignored_hooked_blocks_metadata' ); $after_block_visitor = make_after_block_visitor( $hooked_blocks, $post, 'set_ignored_hooked_blocks_metadata' ); } return traverse_and_serialize_block( $mock_navigation_block, $before_block_visitor, $after_block_visitor ); }