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 / autocomplete_suggestions.php

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

34 lines 844 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 global $wpscfunction;
7
8 $source = 'rest';
9 $params = $request->get_params();
10 $term = isset( $params['search'] ) ? sanitize_text_field($params['search']) : '';
11 $field_slug = isset( $params['field_slug'] ) ? sanitize_text_field($params['field_slug']) : '';
12
13 if ( !$field_slug || !$wpscfunction->is_cf_slug($field_slug) ) {
14 $response = new WP_Error(
15 'invalid_api_parameters',
16 'Invalid api parameters provided.',
17 array(
18 'status' => 403,
19 )
20 );
21 return;
22 }
23
24 include WPSC_ABSPATH . 'includes/admin/tickets/ticket_list/filters/filter_autocomplete.php';
25
26 $response = array();
27
28 foreach ($output as $key => $suggestion) {
29 $response[] = array(
30 'label' => $suggestion['label'],
31 'value' => $suggestion['flag_val'],
32 );
33 }
34