Skip to content

Commit

Permalink
avoid errors for
Browse files Browse the repository at this point in the history
  • Loading branch information
franz-josef-kaiser committed Jan 28, 2013
1 parent deece23 commit a3aedf0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions filterama.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a3aedf0

Please sign in to comment.