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_priority_by_id.php

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

25 lines 725 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 $priority_id = isset( $params['id'] ) ? $params['id'] : 0;
8 $priority = get_term_by('id', $priority_id, 'wpsc_priorities');
9 if ($priority) {
10 $response = array(
11 'id' => $priority->term_id,
12 'name' => $priority->name,
13 'textColor' => get_term_meta( $priority->term_id, 'wpsc_priority_color', true),
14 'backgroundColor' => get_term_meta( $priority->term_id, 'wpsc_priority_background_color', true),
15 );
16 } else {
17 $response = new WP_Error(
18 'not_found',
19 'Priority not found for id '.$priority_id,
20 array(
21 'status' => 404,
22 )
23 );
24 }
25