[wp-trac] [WordPress Trac] #62742: Add Missing REST API Filters to WP_REST_Global_Styles_Revisions_Controller

WordPress Trac noreply at wordpress.org
Fri Dec 27 10:16:03 UTC 2024


#62742: Add Missing REST API Filters to WP_REST_Global_Styles_Revisions_Controller
-------------------------+-----------------------------
 Reporter:  vipulpatil   |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  REST API     |    Version:  6.7
 Severity:  normal       |   Keywords:  needs-patch
  Focuses:  rest-api     |
-------------------------+-----------------------------
 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.

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


More information about the wp-trac mailing list