[wp-trac] [WordPress Trac] #60131: Global styles controllers: extend classes with WP_REST_Posts_Controller and WP_REST_Revisions_Controller

WordPress Trac noreply at wordpress.org
Tue May 28 12:38:45 UTC 2024


#60131: Global styles controllers: extend classes with WP_REST_Posts_Controller and
WP_REST_Revisions_Controller
-------------------------------------------------+-------------------------
 Reporter:  ramonopoly                           |       Owner:
                                                 |  spacedmonkey
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.6
Component:  REST API                             |     Version:  6.3
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests dev-        |     Focuses:
  feedback needs-refresh                         |
-------------------------------------------------+-------------------------
Changes (by swissspidy):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58225" 58225]:
 {{{
 #!CommitTicketReference repository="" revision="58225"
 REST API: Refactor global styles endpoints in REST API to register with
 post type.

 Updated the global styles endpoints in the REST API to extend from
 existing posts and revisions controllers. This reduces duplicated code and
 inconsistencies. The revisions controller is now a subclass of the
 `WP_REST_Revisions_Controller`. Related redundant methods were removed and
 schema generation and collection parameters were adjusted to suit the
 global styles context. Updated permission checks, constructor, and
 collection parameters accordingly. This change allows for easy override of
 these classes using the `register_post_type_args` filter.

 This reintroduces [57624] (reverted in [57628]) with improved backward
 compatibility and further enhancements.

 Props ramonopoly, spacedmonkey, mukesh27, swissspidy.
 Fixes #60131.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60131#comment:50>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list