Opened 7 years ago
Closed 6 years ago
#49647 closed enhancement (maybelater)
Extend REST API search endpoint with "after" and "before" which the posts endpoint already supports
| Reported by: | archon810 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | REST API | Version: | 5.0 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.