Fix filtering unavailable order projects
This commit is contained in:
@@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user