[wp-trac] [WordPress Trac] #45605: REST API: Avoid DB queries from generating sample permalink when possible

WordPress Trac noreply at wordpress.org
Wed Jul 31 20:20:12 UTC 2019


#45605: REST API: Avoid DB queries from generating sample permalink when possible
--------------------------------------+---------------------
 Reporter:  dlh                       |       Owner:  dlh
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  5.3
Component:  REST API                  |     Version:  5.0
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------
Changes (by kadamwhite):

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


Comment:

 In [changeset:"45706" 45706]:
 {{{
 #!CommitTicketReference repository="" revision="45706"
 REST API: Skip processing fields which are not present in the selected
 context.

 In `WP_REST_Controller::get_fields_for_response()`, exclude fields which
 are not registered to appear in the request's context.

 In conjunction with r45705 this prevents the unnecessary computation of
 the sample permalink when making a request that is not context=edit.

 Props dlh.
 Fixes #45605.
 }}}

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


More information about the wp-trac mailing list