[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 19:59:39 UTC 2019


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

Comment (by kadamwhite):

 In [changeset:"45705" 45705]:
 {{{
 #!CommitTicketReference repository="" revision="45705"
 REST API: Generate sample permalink only when a dependent field is
 requested.

 The sample permalink will now only be generated if the derivative
 `permalink_template` or `generated_slug` fields are to be included in the
 response, preventing an unnecessary database request for each post (via
 `wp_unique_post_slug()`) when those fields are not requested.

 Props dlh.
 See #45605.
 }}}

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


More information about the wp-trac mailing list