Created
June 18, 2015 03:04
-
-
Save RickeyMessick/6950d813644a8924c6bf to your computer and use it in GitHub Desktop.
esg search filter
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
add_filter('essgrid_modify_search_query', 'extend_esg_search_args_filter'); | |
/** | |
* Filter to replace teh Essentail Grid Search args | |
* | |
* @return | |
**/ | |
function extend_esg_search_args_filter($args) | |
{ | |
$search_param = $args['s']; | |
$posttype_param = $args['post_type']; | |
//$post_ids = get_posts( array( | |
// 'post_type' => array($posttype_param), | |
// 'tag' => $search_param, | |
//)); | |
$args2 = array( | |
'relation' => 'OR', | |
'tag' => $search_param, | |
); | |
$merged_args = array_merge( $args, $args2 ); | |
return $merged_args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment