WordPress also provide more filter to can change wp query using filters. What i need logical to use filter to override query below sample of code if this helpful for you.
add_filter( 'posts_where', 'posts_where_condition_search' );
$wp_query = new WP_Query(
array(
'post_type' => 'press-release',
'posts_per_page' => -1,
)
);
remove_filter( 'posts_where', 'posts_where_condition_search' );
function posts_where_condition_search( $where ){
$search_string = 'test';
if( isset( $_POST['search']) && !empty($_POST['search']) )
$search_string = $_POST['search'];
if( empty($search_string) )
return $where;
// add your multiple condition here and write your custom filter
$where .= " AND (((wp_posts.post_title LIKE '%$search_string%') OR (wp_posts.post_content LIKE '%$search_string%'))) ";
//$where .= " AND (((wp_posts.post_title LIKE '%$search_string%') OR (wp_posts.post_content LIKE '%$search_string%'))) ";
//$where .= " AND (((wp_posts.post_title LIKE '%$search_string%') OR (wp_posts.post_content LIKE '%$search_string%'))) ";
return $where;
}
https://codex.wordpress.org/Class_Reference/WP_Query#Filters