";
}
+ // Get cats if categoryId is an array
+ $cats = 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 = filter_var( $categoryId, FILTER_VALIDATE_INT ) ) {
+ if ( $catId ) {
//$events = $this->getEventsByCategory( $catId, $limit );
$whereParts[] = "
T.id IN (
$order .= " LIMIT {$limit} OFFSET 0";
}
// Else if the $categoryId is an array
- } else if ( $cats = filter_var( $categoryId, FILTER_VALIDATE_INT, array( 'flags' => FILTER_FORCE_ARRAY ) ) && !empty( $cats ) ) {
+ } else if ( $cats && !empty( $cats ) ) {
$whereParts[] = "
T.id IN (
SELECT event
} else {
if($current_year == $year){
-
+
$sql = 'SELECT MONTH(start_time) as month FROM '. GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX .'times ';
$sql .= "WHERE YEAR(start_time) = $year ";
$sql .= "AND MONTH(start_time) >= MONTH(CURDATE()) ";
$sql .= "AND event IN (select id from ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX ."events WHERE status = 10) ";
$sql .= "GROUP BY month";
-
+
$results[$year] = $wpdb->get_results($sql, ARRAY_A);
} else {
$sql = 'SELECT MONTH(start_time) as month FROM '. GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX .'times ';