Skip to content

Commit

Permalink
Block Library: Add filter for inner blocks in the Navigation block (#…
Browse files Browse the repository at this point in the history
…37998)

* add filter to $inner_blocks

* remove extra line space

* Apply suggestions from code review

* Update index.php

Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
  • Loading branch information
afragen and gziolo authored Sep 13, 2022
1 parent 5ee0a7f commit 5ce0149
Showing 1 changed file with 10 additions and 1 deletion.
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 @@ -502,9 +502,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.
*
* @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

0 comments on commit 5ce0149

Please sign in to comment.