test
This commit is contained in:
@@ -55,25 +55,21 @@ class Wiaas_Order_Project {
|
||||
public static function get_available_order_projects() {
|
||||
$all_terms = get_terms(array(
|
||||
'taxonomy' => 'shop_order_project',
|
||||
'hide_empty' => false
|
||||
'hide_empty' => false,
|
||||
'meta_key' => '_wiaas_is_available',
|
||||
'meta_value' => 'yes'
|
||||
));
|
||||
|
||||
if (is_wp_error($all_terms)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$available_terms = array();
|
||||
|
||||
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 $available_terms;
|
||||
return array_map(function($term) {
|
||||
return array(
|
||||
'id' => $term->term_id,
|
||||
'name' => $term->name
|
||||
);
|
||||
}, $all_terms);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user