| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
|
| 6 |
$response = array(); |
| 7 |
|
| 8 |
$statuses = get_terms([ |
| 9 |
'taxonomy' => 'wpsc_statuses', |
| 10 |
'hide_empty' => false, |
| 11 |
'orderby' => 'meta_value_num', |
| 12 |
'order' => 'ASC', |
| 13 |
'meta_query' => array('order_clause' => array('key' => 'wpsc_status_load_order')), |
| 14 |
]); |
| 15 |
|
| 16 |
foreach ( $statuses as $status ) { |
| 17 |
|
| 18 |
$response[] = array( |
| 19 |
'id' => $status->term_id, |
| 20 |
'name' => $status->name, |
| 21 |
'textColor' => get_term_meta( $status->term_id, 'wpsc_status_color', true), |
| 22 |
'backgroundColor' => get_term_meta( $status->term_id, 'wpsc_status_background_color', true), |
| 23 |
); |
| 24 |
|
| 25 |
} |
| 26 |
|