-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation block: Check for insert_hooked_blocks_into_rest_response i… #62134
Navigation block: Check for insert_hooked_blocks_into_rest_response i… #62134
Conversation
*/ | ||
if ( function_exists( 'set_ignored_hooked_blocks_metadata' ) && ! has_filter( 'rest_prepare_wp_navigation', $rest_prepare_wp_navigation_core_callback ) ) { | ||
if ( | ||
! has_filter( 'rest_prepare_wp_navigation', 'insert_hooked_blocks_into_rest_response' ) && |
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.
I think the main question for this PR is if we're happy with this tentative name (insert_hooked_blocks_into_rest_response
).
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ packages/block-library/src/navigation/index.php |
I'll go ahead and land this, to unblock WordPress/wordpress-develop#6677. It's very low-risk, as it only adds another condition to determine whether or not to add the It's very similar in nature to #61903, and will allow us to harmonize the hooked blocks injection code (moving it out of the Navigation block and into Core, see https://core.trac.wordpress.org/ticket/60759). |
…n Core (WordPress#62134) Adding another `has_filter` check before adding the Navigation block's `block_core_navigation_insert_hooked_blocks_into_rest_response` filter to insert hooked blocks into the REST API response for a `wp_navigation` post type.
…n Core (WordPress#62134) Adding another `has_filter` check before adding the Navigation block's `block_core_navigation_insert_hooked_blocks_into_rest_response` filter to insert hooked blocks into the REST API response for a `wp_navigation` post type.
Related PR: WordPress/wordpress-develop#6677
What?
Adding another
has_filter
check before adding the Navigation block's filter to insert hooked blocks into the REST API response for awp_navigation
post type.Why?
The logic to add hooked blocks to a
wp_navigation
post type REST responses is being moved into Core, see WordPress/wordpress-develop#6677.Modeled after #61903.