Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#43956 closed feature request (duplicate)

_embed parameter should accept options on what to embed

Reported by: k1sul1 Owned by:
Priority: normal Milestone:
Component: REST API Version:
Severity: normal Keywords: needs-patch
Cc: Focuses:

Description

When creating a JavaScript powered single page application, performance is critical, and that's where _embed comes in. Instead of making separate requests for author, featured media, replies & terms, we can simply add _embed=1 as a query parameter, and everything embeddable is embedded into the response. HTTP2 is a thing, but WordPress bootstrap tends to take a while.

The thing is, in our use case, we really do not want the replies to be embedded, as they're useless until the user actually reads the article. That's why we'd like to load them in a separate request when they're actually needed.

We load dozens of posts in the front page of our app, which equals a "lot" of unneeded replies being loaded, and embedding replies can't be free in terms of performance.

Could we specify what we want to embed, in the parameter?

Something like ?_embed=featured_media,terms,author. ?_embed=1 would still embed everything, so anything existing shouldn't break.

Change History (2)

#1 @TimothyBlynJacobs
8 years ago

  • Resolutionduplicate
  • Status newclosed

Welcome to trac! We are already tracking this issue in #39696.

#2 @netweb
8 years ago

  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.