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 / admin / settings / get_edit_category.php

get_edit_category.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent 2.3.1, at includes/admin/settings/get_edit_category.php

36 lines 1.1 KB
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 $current_user;
7 if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
8
9 $cat_id = isset($_POST) && isset($_POST['cat_id']) ? intval($_POST['cat_id']) : 0;
10 if (!$cat_id) {exit;}
11
12 $category = get_term_by('id', $cat_id, 'wpsc_categories');
13
14 ob_start();
15 ?>
16 <div class="form-group">
17 <label for="wpsc_cat_name"><?php _e('Category Name','supportcandy');?></label>
18 <p class="help-block"><?php _e('Insert category name.','supportcandy');?></p>
19 <input id="wpsc_cat_name" class="form-control" name="wpsc_cat_name" value="<?php echo esc_attr($category->name);?>" />
20 </div>
21 <?php
22 $body = ob_get_clean();
23 ob_start();
24 ?>
25 <button type="button" class="btn wpsc_popup_close" onclick="wpsc_modal_close();"><?php _e('Close','supportcandy');?></button>
26 <button type="button" class="btn wpsc_popup_action" onclick="wpsc_set_edit_category(<?php echo esc_attr($cat_id)?>);"><?php _e('Save Changes','supportcandy');?></button>
27 <?php
28 $footer = ob_get_clean();
29
30 $output = array(
31 'body' => $body,
32 'footer' => $footer
33 );
34
35 wp_send_json($output);
36