[wp-trac] [WordPress Trac] #57749: In REST APIs, only prime meta data if there are registered keys

WordPress Trac noreply at wordpress.org
Fri Feb 17 08:52:15 UTC 2023


#57749: In REST APIs, only prime meta data if there are registered keys
-----------------------------------+-----------------------------
 Reporter:  spacedmonkey           |      Owner:  (none)
     Type:  enhancement            |     Status:  new
 Priority:  normal                 |  Milestone:  Awaiting Review
Component:  REST API               |    Version:  4.4
 Severity:  normal                 |   Keywords:
  Focuses:  rest-api, performance  |
-----------------------------------+-----------------------------
 For REST API controllers like post, term, comment, this use Query classes
 like WP_Query, WP_Term_Query and WP_Comment_Query under the hood. By
 default of these query classes, also prime related meta data. This means
 that when a user requests one of these endpoints, meta data is primed
 along with the main object.  However, this meta data may not be used in
 anywhere, making this priming unnessary. Meta data should only be primed,
 if there are registered meta keys that are going to be used.

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


More information about the wp-trac mailing list