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