Skip to content

Instantly share code, notes, and snippets.

@RickeyMessick
Created June 18, 2015 03:04
Show Gist options
  • Save RickeyMessick/6950d813644a8924c6bf to your computer and use it in GitHub Desktop.
Save RickeyMessick/6950d813644a8924c6bf to your computer and use it in GitHub Desktop.
esg search filter
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