From a3aedf033bb2d76abc9608130c0c877ed6d60569 Mon Sep 17 00:00:00 2001 From: Kaiser Franz Josef Date: Mon, 28 Jan 2013 16:46:01 +0100 Subject: [PATCH] avoid errors for --- filterama.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/filterama.php b/filterama.php index dd3aff2..a83fe3e 100644 --- a/filterama.php +++ b/filterama.php @@ -122,14 +122,19 @@ public function all_or_any_markup() public function all_or_any( $match ) { global $wpdb; - $array_of_ids = $_GET['match_all']; + $param = 'match_all'; if ( - isset( $array_of_ids ) - AND ! empty( $array_of_ids ) + isset( $_GET[ $param ] ) + AND ! empty( $_GET[ $param ] ) ) $match .= $wpdb->prepare( - " AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id IN (%s))" - ,implode( ",", $array_of_ids ) + " AND ID IN ( + SELECT object_id + FROM {$wpdb->term_relationships} + WHERE term_taxonomy_id + IN (%s) + )" + ,implode( ",", $_GET[ $param ] ) ); return $match;