Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#25664 closed defect (bug) (fixed)

Behavior of the 'posts_search' filter has changed

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: nacin's profile nacin
Milestone: 3.7 Priority: normal
Severity: normal Version: 3.7
Component: Query Keywords: has-patch
Focuses: Cc:


As reported on the forums, [25632] changed the behaviour of the posts_search filter.

In 3.6, the filter is applied unconditionally, even when the 's' query var is empty.

In 3.7-RC1, the filter has been moved into WP_Query::parse_search(), which is only executed if $q['s'] is not empty, so a plugin cannot add a search clause to a query if it doesn't have one.

Attachments (1)

25664.patch (1.1 KB) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
11 years ago

25664.patch restores the 3.6 behaviour.

#2 @nacin
11 years ago

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

In 25867:

Always apply the posts_search filter. Restores 3.6 behavior.

props SergeyBiryukov.
fixes #25664.

#3 @SergeyBiryukov
11 years ago

  • Version changed from trunk to 3.7
Note: See TracTickets for help on using tickets.