PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 2.3.1
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v2.3.1
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
supportcandy / includes / rest_api / v1 / get_status_by_id.php

get_status_by_id.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent 2.3.1, at includes/rest_api/v1/get_status_by_id.php

24 lines 696 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5
6 $params = $request->get_params();
7 $status_id = isset( $params['id'] ) ? $params['id'] : 0;
8 $status = get_term_by('id', $status_id, 'wpsc_statuses');
9 if ($status) {
10 $response = array(
11 'id' => $status->term_id,
12 'name' => $status->name,
13 'textColor' => get_term_meta( $status->term_id, 'wpsc_status_color', true),
14 'backgroundColor' => get_term_meta( $status->term_id, 'wpsc_status_background_color', true),
15 );
16 } else {
17 $response = new WP_Error(
18 'not_found',
19 'Status not found for id '.$status_id,
20 array(
21 'status' => 404,
22 )
23 );
24 }