Make WordPress Core

Opened 16 months ago

#57749 new enhancement

In REST APIs, only prime meta data if there are registered keys

Reported by: spacedmonkey's profile spacedmonkey Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.4
Component: REST API Keywords:
Focuses: rest-api, performance Cc:


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.

Change History (0)

Note: See TracTickets for help on using tickets.