I have a working query that calls all my posts that have a certain meta value for one of two meta keys:
$term = $_GET['term']; $args = array( 'post_type' => 'some_cpt_name', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'foo', 'value' => $term, 'compare' => 'LIKE', ), array( 'key' => 'bar', 'value' => $term, 'compare' => 'LIKE', ), ) ); $query = get_posts( $args );
I need to query all posts that have the
$term as meta key "foo" or "bar" or as post title. Problem is how to add the post title as additional possible key?
Q: How can I also check if the
$termmaybe is in the