Opened 12 months ago
Closed 5 months ago
#49647 closed enhancement (maybelater)
Extend REST API search endpoint with "after" and "before" which the posts endpoint already supports
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.0 |
Component: | REST API | Keywords: | |
Focuses: | Cc: |
Description
Hi,
I'd like to use the search API but provide the after
parameter. I was surprised to see there's no parity to posts
and it's not supported.
https://developer.wordpress.org/rest-api/reference/posts/
https://developer.wordpress.org/rest-api/reference/search-results/
Is there a reason most, if not all, params supported by posts
aren't present in search
? Can they be?
Thanks.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Hi @archon810,
The purpose of the Search endpoint is to provide a unified, minimal interface for performing basic searches across a variety of different WordPress entities; it has been recently extended to support terms and post formats.
Searching by date isn't something that can be universally implemented.
I would instead recommend using the existing posts endpoint for performing those searches, or implementing a custom endpoint.