Fix filtering unavailable order projects
This commit is contained in:
@@ -62,16 +62,16 @@ class Wiaas_Order_Project {
|
||||
return array();
|
||||
}
|
||||
|
||||
$available_terms = array_filter($all_terms, function($term) {
|
||||
return self::is_order_project_available($term->term_id);
|
||||
});
|
||||
foreach ($all_terms as $term) {
|
||||
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 array(
|
||||
'id' => $term->term_id,
|
||||
'name' => $term->name
|
||||
);
|
||||
}, $available_terms);
|
||||
return $available_terms;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user