Skip to content

Commit

Permalink
Short circuit the WP_REST_Pattern_Directory_Controller controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-vlasenko committed Jan 2, 2025
1 parent f7da05f commit 39c326f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ public function get_items( $request ) {
return $raw_patterns;
}

if ( $request->is_method( 'HEAD' ) ) {
// Return early as this handler doesn't add any response headers.
return new WP_REST_Response();
}

$response = array();

if ( $raw_patterns ) {
Expand Down

0 comments on commit 39c326f

Please sign in to comment.