[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 Feb 13 14:07:54 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.5
Component:  REST API                         |     Version:  trunk
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+---------------------------
Changes (by spacedmonkey):

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


Comment:

 In [changeset:"57624" 57624]:
 {{{
 #!CommitTicketReference repository="" revision="57624"
 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.

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

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


More information about the wp-trac mailing list