Attachments controller: use 6.7 compat method #73634
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Update Gutenberg REST Templates Controller: Change request method check from
is_method()toget_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.