Make WordPress Core

Opened 15 months ago

Closed 14 months ago

Last modified 14 months 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
15 months ago

Maybe related: #58031

Last edited 15 months ago by SergeyBiryukov (previous) (diff)

#2 @zodiac1978
15 months ago

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

#4 @zodiac1978
14 months 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
14 months ago

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