Fix for no categories
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 28 Jul 2017 13:17:14 +0000 (09:17 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 28 Jul 2017 13:17:14 +0000 (09:17 -0400)
was an error. cats would return an array with a false value.

models/front/events/baseAction.php

index 69d45f3..2a03575 100644 (file)
@@ -238,7 +238,7 @@ abstract class GlmMembersFront_events_baseAction extends GlmDataEvents
         }
 
         // Get cats if categoryId is an array
-        $cats  = filter_var( $categoryId, FILTER_VALIDATE_INT, array( 'flags' => FILTER_FORCE_ARRAY ) );
+        $cats  = array_filter( filter_var( $categoryId, FILTER_VALIDATE_INT, array( 'flags' => FILTER_FORCE_ARRAY ) ) );
         $catId = filter_var( $categoryId, FILTER_VALIDATE_INT );
         // If a category ID is supplied
         if ( $catId ) {