WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 5 months ago

Last modified 5 months ago

#45454 closed enhancement (fixed)

REST API: Allow to filter the query in the search controller

Reported by: Chouby Owned by: desrosj
Milestone: 5.1 Priority: normal
Severity: normal Version: 5.0
Component: REST API Keywords: has-patch
Focuses: Cc:

Description

[43739] introduced a new search controller. However, unlike ther controllers, it doesn't propose a convenient way to filter the query.

I propose to add a new filter rest_search_query similar to the filter rest_{$type}_query offered by other controllers.

Attachments (2)

45454.diff (928 bytes) - added by Chouby 7 months ago.
45454.2.diff (1000 bytes) - added by swissspidy 6 months ago.

Download all attachments as: .zip

Change History (11)

#1 @swissspidy
7 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.0.1
  • Type changed from defect (bug) to enhancement

@Chouby
7 months ago

#2 @Chouby
7 months ago

  • Keywords has-patch added; needs-patch removed

#3 @pento
6 months ago

  • Milestone changed from 5.0.1 to 5.0.2

#4 @pento
6 months ago

  • Milestone changed from 5.0.2 to 5.0.3

#5 @audrasjb
6 months ago

  • Keywords needs-refresh added

Hi,

5.0.3 is going to be released in a couple of weeks. We are currently sorting the remaining tickets in the milestone. The ticket is sorted in milestone 5.0.3, but requires an @since refresh and a commit/backport to the associated branch. That would be nice to have a refreshed patch asap.

@swissspidy
6 months ago

#6 @swissspidy
6 months ago

  • Keywords commit added; needs-refresh removed

#7 @desrosj
5 months ago

  • Milestone changed from 5.0.3 to 5.1

New filters fall outside of the 5.0.3 scope. Moving to 5.1.

#8 @desrosj
5 months ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 44482:

REST API: Introduce rest_post_search_query filter.

This filter allows the query arguments to be manipulated for a post search query in the REST API.

Props Chouby, swissspidy.
Fixes #45454.

#9 @desrosj
5 months ago

  • Keywords commit removed
Note: See TracTickets for help on using tickets.