From 33cde1b228b88d9dc633fa78bd559daaadb38041 Mon Sep 17 00:00:00 2001 From: Georgios Panayi Date: Mon, 14 Nov 2016 10:42:53 +0200 Subject: [PATCH 1/2] Fixed filtering enqueue by post type Method was always returning true so filtering wasn't working --- Herbert/Framework/Enqueue.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Herbert/Framework/Enqueue.php b/Herbert/Framework/Enqueue.php index 160a960..9fd795b 100644 --- a/Herbert/Framework/Enqueue.php +++ b/Herbert/Framework/Enqueue.php @@ -327,7 +327,7 @@ public function filterSearch($attrs, $filterWith) */ public function filterPostType($attrs, $filterWith) { - return array_search(get_post_type(), $filterWith) !== null; + return array_search(get_post_type(), $filterWith) !== FALSE ? TRUE : FALSE; } } From 5841cb8c1e794618b6910382b0edd3f60c7d44b8 Mon Sep 17 00:00:00 2001 From: Georgios Panayi Date: Thu, 17 Nov 2016 09:34:22 +0200 Subject: [PATCH 2/2] Removed ternary operator --- Herbert/Framework/Enqueue.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Herbert/Framework/Enqueue.php b/Herbert/Framework/Enqueue.php index 9fd795b..c0cf67a 100644 --- a/Herbert/Framework/Enqueue.php +++ b/Herbert/Framework/Enqueue.php @@ -327,7 +327,7 @@ public function filterSearch($attrs, $filterWith) */ public function filterPostType($attrs, $filterWith) { - return array_search(get_post_type(), $filterWith) !== FALSE ? TRUE : FALSE; + return array_search(get_post_type(), $filterWith) !== FALSE; } }