Opened 17 months ago
Last modified 15 months ago
#63056 assigned enhancement
Add Missing rest_prepare_ Filters to Several REST API Controllers
| Reported by: | vipulpatil | Owned by: | vipulpatil |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | REST API | Version: | |
| Severity: | normal | Keywords: | changes-requested has-patch |
| Cc: | Focuses: | rest-api, coding-standards |
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.
17 months ago
#1
- Keywords has-patch added
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
## 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