[wp-trac] [WordPress Trac] #63056: Add Missing rest_prepare_ Filters to Several REST API Controllers

WordPress Trac noreply at wordpress.org
Wed Mar 5 08:18:13 UTC 2025


#63056: Add Missing rest_prepare_ Filters to Several REST API Controllers
----------------------------------------+-------------------------------
 Reporter:  vipulpatil                  |      Owner:  vipulpatil
     Type:  enhancement                 |     Status:  assigned
 Priority:  normal                      |  Milestone:  Awaiting Review
Component:  REST API                    |    Version:  trunk
 Severity:  normal                      |   Keywords:  changes-requested
  Focuses:  rest-api, coding-standards  |
----------------------------------------+-------------------------------
 **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:

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63056>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list