-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @afragen! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
* | ||
* @param \WP_Block_List $inner_blocks | ||
*/ | ||
$inner_blocks = apply_filters( 'render_block_core_navigation_inner_blocks', $inner_blocks ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one filter that uses a different naming pattern. Let's align it with:
gutenberg/packages/block-library/src/navigation/index.php
Lines 333 to 345 in 8247dd0
/** | |
* Filters the fallback experience for the Navigation block. | |
* | |
* Returning a falsey value will opt out of the fallback and cause the block not to render. | |
* To customise the blocks provided return an array of blocks - these should be valid | |
* children of the `core/navigation` block. | |
* | |
* @since 5.9.0 | |
* | |
* @param array[] default fallback blocks provided by the default block mechanic. | |
*/ | |
return apply_filters( 'block_core_navigation_render_fallback', $fallback_blocks ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afragen, thank you for your contribution.
Description
Add filter to navigation.php to add ability to modify navigation block menu items.
Fixes #37717
Types of changes
New feature: filter menu items of navigation block.
Checklist:
*.native.js
files for terms that need renaming or removal).