From 7959bb36524ba673cffee25bae1fff5cce4a4ba4 Mon Sep 17 00:00:00 2001 From: Helmut Januschka Date: Mon, 7 Oct 2019 10:34:45 +0200 Subject: [PATCH] term search by EP --- src/Core.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Core.php b/src/Core.php index 96162d6..142ef00 100644 --- a/src/Core.php +++ b/src/Core.php @@ -264,6 +264,25 @@ public function ep_config_mapping($mapping) public function ep_formatted_args($args) { + if (isset($_GET['rekog_celebs'])) { + $args['post_filter']['bool']['must'][] = [ + 'term' => [ + 'rekog_celebs.slug' => $_GET['rekog_celebs'], + ], + ]; + + return $args; + } + if (isset($_GET['rekog_persons'])) { + $args['post_filter']['bool']['must'][] = [ + 'term' => [ + 'rekog_persons.slug' => $_GET['rekog_persons'], + ], + ]; + + return $args; + } + if (! array_key_exists('bool', $args['query'])) { return $args; } @@ -289,6 +308,7 @@ public function ep_formatted_args($args) //echo "
";
         //echo json_encode($args);
         //exit;
+
         return $args;
     }