• Hi,

    Seems like the search field for posts and media defaults to an AND operation when using multiple criteria. Is there a way to change that to OR?

    I have a list of media filenames and I am looking for a easy way to get them all in one view to perform a bulk action.

    thanks

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    There’s a way with custom coding. The search uses the same WP_Query::get_posts() as is used for front end searches. Thus the “posts_request” filter can be used to alter the SQL used. Your filter callback could search and replace specific AND with OR. String substitution like this is finicky and inherently weak, but it will work. Use get_current_screen() to make sure you’re only altering the right query, and be sure it’s a search query being altered.

Viewing 1 replies (of 1 total)
  • The topic ‘Backend posts search using multiple criteria’ is closed to new replies.