From c493bffec00bcfbf128aadcc7136320b8a387fc8 Mon Sep 17 00:00:00 2001 From: arttu Date: Mon, 18 Feb 2019 16:01:20 +0200 Subject: [PATCH] fix tip search & optimize meta comparing --- content/themes/custom/models/search.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/content/themes/custom/models/search.php b/content/themes/custom/models/search.php index c70cacd..ef0f9d5 100644 --- a/content/themes/custom/models/search.php +++ b/content/themes/custom/models/search.php @@ -130,25 +130,19 @@ protected function get_post_list( stdClass $params ) { $result = wp_cache_get( $cache_key ); if ( empty( $result ) ) { $args = [ - 'post_type' => [ 'page', 'pof_tip' ], + 'post_type' => 'any', 'post_status' => 'publish', 'posts_per_page' => -1, //phpcs:ignore 'meta_query' => [ 'relation' => 'OR', [ 'key' => 'api_type', - 'value' => 'task', - 'compare' => '=', - ], - [ - 'key' => 'api_type', - 'value' => 'taskgroup', - 'compare' => '=', - ], - [ - 'key' => 'api_type', - 'value' => 'pof_tip', - 'compare' => '=', + 'compare' => 'IN', + 'value' => [ + 'task', + 'taskgroup', + 'pof_tip', + ], ], ], ];