Created
June 17, 2021 19:26
-
-
Save pickplugins/d5cb5e5c2c847b12829d0ab7539c8c0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function me_search_query( $query ) { | |
if ( $query->is_search ) { | |
$meta_query_args = array( | |
array( | |
'key' => 'accordions_options', | |
'value' => $query->query_vars['s'] = '', | |
'compare' => 'LIKE', | |
), | |
); | |
$query->set('meta_query', $meta_query_args); | |
}; | |
} | |
add_filter( 'pre_get_posts', 'me_search_query'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment