Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

Add HEAD method support for performance optimization in REST API list controller #16

Description

@gziolo

Follow-up for https://github.com/WordPress/abilities-api/pull/6/files#r2272811454.

get_items should return early with an empty body, but include X-WP-Total and X-WP-TotalPages headers when HEAD method selected.
See other usage for reference:

https://github.com/WordPress/wordpress-develop/blob/909879656d3afa03745a17ecfa45623e4a2b314e/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php#L316-L318

Related TODO item:

public function get_items( $request ) {
// TODO: Add HEAD method support for performance optimization.
// Should return early with empty body but include X-WP-Total and X-WP-TotalPages headers.
// See: https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php#L316-L318

Metadata

Metadata

Assignees

Labels

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions