Skip to content

Commit

Permalink
term search by EP
Browse files Browse the repository at this point in the history
  • Loading branch information
hjanuschka committed Oct 7, 2019
1 parent ac50063 commit 7959bb3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -289,6 +308,7 @@ public function ep_formatted_args($args)
//echo "<pre>";
//echo json_encode($args);
//exit;

return $args;
}

Expand Down

0 comments on commit 7959bb3

Please sign in to comment.