Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Library: Add filter for inner blocks in the Navigation block #37998

Merged
merged 4 commits into from
Sep 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,18 @@ function render_block_core_navigation( $attributes, $content, $block ) {
}

$inner_blocks = new WP_Block_List( $fallback_blocks, $attributes );

}

/**
* Filter navigation block $inner_blocks.
* Allows modification of a navigation block menu items.
gziolo marked this conversation as resolved.
Show resolved Hide resolved
*
* @since 6.1.0
*
* @param \WP_Block_List $inner_blocks
*/
$inner_blocks = apply_filters( 'block_core_navigation_render_inner_blocks', $inner_blocks );

$layout_justification = array(
'left' => 'items-justified-left',
'right' => 'items-justified-right',
Expand Down