Classic Block: Use get_post() in wp_declare_classic_block_necessary#78613
Conversation
…ic_block_necessary Aligns the Gutenberg implementation with the Core PR by removing the `global $post;` indirection in favor of `get_post()`, adding a `: void` return type, and refreshing the function docblock. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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. |
get_post() in wp_declare_classic_block_necessary
|
Flaky tests detected in 12d38a8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/26365060051
|
What
Small cleanup to
wp_declare_classic_block_necessary()in the WordPress 7.1 compat layer:global $post;withget_post().: voidreturn type.@since 7.1.0).Why
Aligns this Gutenberg implementation with the version proposed in the corresponding Core PR (wordpress-develop#11712) so the two stay in sync.
No behavior change.
Testing instructions
<!-- wp:freeform -->block) and confirm the Classic block renders correctly and is editable.add_filter( 'wp_classic_block_supports_inserter', '__return_true' );(or use this plugin) and verify the Classic block appears in the inserter.🤖 Generated with Claude Code