Skip to content

Commit 41ec679

Browse files
budzanowskibudzanowskigziolo
authored
Fix backwards compatibility with WP_REST_Request API (WordPress#98)
Replace is_method() with get_method() for WordPress compatibility. The is_method() method does not exist on WP_REST_Request in earlier WordPress versions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: budzanowski <budzanowski@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
1 parent 80f47ee commit 41ec679

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/rest-api/endpoints/class-wp-rest-abilities-list-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function get_items( $request ) {
105105
$total_abilities = count( $abilities );
106106
$max_pages = ceil( $total_abilities / $per_page );
107107

108-
if ( $request->is_method( 'HEAD' ) ) {
108+
if ( $request->get_method() === 'HEAD' ) {
109109
$response = new \WP_REST_Response( array() );
110110
} else {
111111
$abilities = array_slice( $abilities, $offset, $per_page );

0 commit comments

Comments
 (0)