Opened 12 months ago
Last modified 9 months ago
#63056 assigned enhancement
Add Missing rest_prepare_ Filters to Several REST API Controllers
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | REST API | Keywords: | changes-requested has-patch |
| Focuses: | rest-api, coding-standards | Cc: |
Description
Issue
Several WordPress REST API controllers lack rest_prepare_ filters, creating inconsistent extensibility across different resource types. The affected controllers do not provide a standard mechanism for developers to modify API responses, limiting the ability to customize or extend REST API outputs.
Proposed Solution
Implement rest_prepare_ filters for the following controllers:
class-wp-rest-block-patterns-controller class-wp-rest-block-pattern-categories-controller class-wp-rest-global-styles-controller class-wp-rest-templates-controller class-wp-rest-template-revisions-controller class-wp-rest-template-autosaves-controller class-wp-rest-search-controller
Add a standard filter implementation in each controller's prepare_item_for_response() method:
Change History (2)
This ticket was mentioned in PR #8462 on WordPress/wordpress-develop by @vipulpatil.
12 months ago
#1
- Keywords has-patch added
Note: See
TracTickets for help on using
tickets.
## Summary
This PR adds new
rest_prepare_filters to block pattern-related REST API controllers, enhancing the extensibility of WordPress REST API for block patterns and block pattern categories.### Changes Made
rest_prepare_block_patternfilter toclass-wp-rest-block-patterns-controllerrest_prepare_block_pattern_categoryfilter toclass-wp-rest-block-patterns-categories-controllerTrac ticket: https://core.trac.wordpress.org/ticket/63056