Skip to content

Conversation

@ramonjd
Copy link
Member

@ramonjd ramonjd commented Nov 28, 2025

What?

Update Gutenberg REST Templates Controller: Change request method check from is_method() to get_method() for HEAD requests to comply with minimum WordPress version requirements.

The use of is_method() was committed in #73477, since it matched Core.
Unit tests passed locally on the branch, but appear to break things on the trunk CI.

Important

This adjustment is specific to Gutenberg and should not be backported to Core.

Why

The tests were failing because they were running against WP 6.7, and in that version there is no such method as is_method()

Call to undefined method WP_REST_Request::is_method() in the file: wp-content/plugins/gutenberg/lib/compat/wordpress-7.0/class-gutenberg-rest-templates-controller-7-0.php at line 153.

For now, and until WP 6.8 becomes the minimum version after the release of 6.9, let's make the extension class compatible with 6.7.

Once 6.9 is released, we can make Gutenberg's minimum version 6.8 and revert this change.

See: https://core.trac.wordpress.org/changeset/59899

Testing

Tests should pass.

…ck from is_method() to get_method() for HEAD requests to comply with minimum WordPress version requirements. This adjustment is specific to Gutenberg and should not be backported to core.
@ramonjd ramonjd added the Backwards Compatibility Issues or PRs that impact backwards compatability label Nov 28, 2025
@ramonjd ramonjd added the No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core label Nov 28, 2025
@ramonjd ramonjd requested review from andrewserong and removed request for spacedmonkey November 28, 2025 02:09
@ramonjd ramonjd self-assigned this Nov 28, 2025
@ramonjd ramonjd added the [Type] Build Tooling Issues or PRs related to build tooling label Nov 28, 2025
…ity on request method check for HEAD requests, ensuring compliance with minimum WordPress version requirements. This change is specific to Gutenberg and should not be backported to core.
@github-actions
Copy link

github-actions bot commented Nov 28, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ramonjd <[email protected]>
Co-authored-by: andrewserong <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ramonjd
Copy link
Member Author

ramonjd commented Nov 28, 2025

Branch passes might be related to:

Thanks to @andrewserong for digging that up

@ramonjd ramonjd enabled auto-merge (squash) November 28, 2025 02:28
@ramonjd ramonjd merged commit acb4345 into trunk Nov 28, 2025
35 checks passed
@ramonjd ramonjd deleted the update/controller-is_method-get_method-6.7 branch November 28, 2025 02:49
@github-actions github-actions bot added this to the Gutenberg 22.3 milestone Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backwards Compatibility Issues or PRs that impact backwards compatability No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants