Commit 8f84ca6f authored by Noemie Kerroux's avatar Noemie Kerroux

Add multiple_words option

parent 0e937585
......@@ -21,6 +21,7 @@ class WPGlobalSearch {
],
'posts_per_page' => (!empty($args['posts_per_page'])) ? $args['posts_per_page'] : 12,
'search_if_empty' => (!empty($args['search_if_empty'])) ? $args['search_if_empty'] : true,
'multiple_words' => (isset($args['multiple_words'])) ? $args['multiple_words'] : true,
'taxonomies' => (!empty($args['taxonomies'])) ? $args['taxonomies'] : [],
'post_metas' => (!empty($args['post_metas'])) ? $args['post_metas'] : [],
'search_on' => [
......@@ -35,8 +36,12 @@ class WPGlobalSearch {
$count_articles = 0;
$count_pages = 0;
$last_page = 0;
if($default_args['multiple_words']) {
$query_array = (!empty($query)) ? explode(' ', $query) : [];
}else {
$query_array = array($query);
}
$query_array = (!empty($query)) ? explode(' ', $query) : [];
$page = (!empty($_GET['page'])) ? trim(strip_tags($_GET['page'])) : 1;
$post_title_likes = "";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment