[wp-trac] [WordPress Trac] #51596: Posts embedded in search results are incomplete
WordPress Trac
noreply at wordpress.org
Thu Oct 22 00:13:15 UTC 2020
#51596: Posts embedded in search results are incomplete
-------------------------+-----------------------------
Reporter: iandunn | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
r46434 (#47684) made it possible to embed a post within a search results
response (e.g., `/wp-json/wp/v2/search?search=hello&_embed=self`). The
object that gets embedded is incomplete, though. For instance, it has
`slug` and `excerpt`, but not `content`, `status`, `meta`, etc.
I'd like to be able to make a single request to the search endpoint, and
obtain everything I need to know about the results, including its embedded
terms, author, etc. Currently it seems like I need to make one request to
get the IDs, and then another request to get the full info for all those
posts.
A workaround would be `register_rest_field( 'search-result', ...`, but
modifying the Core endpoint feels hacky.
Possibly related: #49538, #49985
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51596>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list