Opened 7 weeks ago
Last modified 5 weeks ago
#62742 new enhancement
Add Missing REST API Filters to WP_REST_Global_Styles_Revisions_Controller
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.7 |
Component: | REST API | Keywords: | has-patch |
Focuses: | rest-api | Cc: |
Description
This ticket is created in response to a Gutenberg GitHub issue raised by anton-vlasenko and confirmed by ramonjd here https://github.com/WordPress/gutenberg/issues/68327
The issue highlights that the WP_REST_Global_Styles_Revisions_Controller class is missing standard WordPress REST API filters, such as rest_revision_query and rest_prepare_revision. According to ramonjd, the omission was intentional initially, as the endpoint was new and evolving, and public APIs were not introduced prematurely.
However, now that https://github.com/WordPress/wordpress-develop/pull/5699 has been completed, it makes sense to add these filters to align with WordPress REST API conventions and ensure consistency.
Proposed Solution:
Add the missing filters to the WP_REST_Global_Styles_Revisions_Controller class.
Use unique filter names, such as rest_global_styles_query and rest_prepare_global_styles_revision.
Backport these changes to WordPress Core for parity with Gutenberg and to provide developers with consistent, extensible APIs.
This update will enhance developer experience and maintain consistency with other REST controllers across the WordPress ecosystem.
Change History (2)
This ticket was mentioned in PR #8062 on WordPress/wordpress-develop by @vipulpatil.
7 weeks ago
#1
- Keywords has-patch added; needs-patch removed
@vipulpatil commented on PR #8062:
5 weeks ago
#2
@Mamaduka Can you take a look at this PR 🙇
## Summary
This PR adds two standard WordPress REST API filters to the Global Styles Revisions controller:
rest_global_styles_revision_query
andrest_prepare_global_styles_revision
.Currently, WP_REST_Global_Styles_Revisions_Controller lacks the standard WordPress REST filters, likely an oversight since other revision controllers include them.
### Changes Proposed
rest_global_styles_revision_query
filter for query modificationrest_prepare_global_styles_revision
filter for response data modificationTrac ticket: https://core.trac.wordpress.org/ticket/62742