Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#58080 closed defect (bug) (duplicate)

No results block is showing although results are found if filter is used

Reported by: zodiac1978's profile zodiac1978 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:

Description

I added an additional condition to the post_search or posts_where filter:

$where .= " AND {$wpdb->posts}.post_content LIKE '%bar%'";

The title of one post is containing "foo" and I'm searching for "foo".

Because "bar" is part of the post_content of this post and "foo" is part of the title, it shows the post as a search result.

But the no results block is showing too.

If no filter is modifying the search results, this is not showing.

Change History (5)

#1 @zodiac1978
2 years ago

Maybe related: #58031

Last edited 2 years ago by SergeyBiryukov (previous) (diff)

#2 @zodiac1978
2 years ago

You need to use Twenty-Twenty Three (or add the no results block manually to your site) to see the problem.

#4 @zodiac1978
2 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Removed my code filtering the where clause, but the bug remains, so I think this is a duplicate of #58031

#5 @desrosj
2 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.