Fix filtering unavailable order projects

This commit is contained in:
Almira Krdzic
2018-09-25 13:47:25 +02:00
parent 4ecadc8bcc
commit e1a1b4dc49

View File

@@ -62,16 +62,16 @@ class Wiaas_Order_Project {
return array(); return array();
} }
$available_terms = array_filter($all_terms, function($term) { foreach ($all_terms as $term) {
return self::is_order_project_available($term->term_id); if (self::is_order_project_available($term->term_id)) {
}); $available_terms[] = array(
'id' => $term->term_id,
'name' => $term->name
);
}
}
return array_map(function($term) { return $available_terms;
return array(
'id' => $term->term_id,
'name' => $term->name
);
}, $available_terms);
} }
/** /**