Site icon Hip-Hop Website Design and Development

WP Question – Search in title or author_name

My want is to have a WPQuery that searches for posts which title is ‘check’ OR author_name is ‘check’.

Right here is the code I attempted:

$search_query = get_search_query();

$args = array(
    'relation' => 'OR',
    array(
        'key' => 'title',
        'worth' => $search_query,
        'examine' => 'LIKE'
    ),
    array(
        'key' => 'author_name',
        'worth' => $search_query,
        'examine' => 'LIKE'
    )
);
$wp_query = new WP_Query($args);

I do know that this code is meta_query fashion, however I am making an attempt to have OR in WP_Query