| 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 |
ob_start(); |
| 10 |
?> |
| 11 |
<div class="form-group"> |
| 12 |
<label for="wpsc_cat_name"><?php _e('Category Name','supportcandy');?></label> |
| 13 |
<p class="help-block"><?php _e('Insert category name. Please make sure category name you are entering should not already exist.','supportcandy');?></p> |
| 14 |
<input id="wpsc_cat_name" class="form-control" name="wpsc_cat_name" value="" /> |
| 15 |
</div> |
| 16 |
<?php |
| 17 |
$body = ob_get_clean(); |
| 18 |
ob_start(); |
| 19 |
?> |
| 20 |
<button type="button" class="btn wpsc_popup_close" onclick="wpsc_modal_close();"><?php _e('Close','supportcandy');?></button> |
| 21 |
<button type="button" class="btn wpsc_popup_action" onclick="wpsc_set_add_category();"><?php _e('Submit','supportcandy');?></button> |
| 22 |
<?php |
| 23 |
$footer = ob_get_clean(); |
| 24 |
|
| 25 |
$output = array( |
| 26 |
'body' => $body, |
| 27 |
'footer' => $footer |
| 28 |
); |
| 29 |
|
| 30 |
wp_send_json($output); |
| 31 |
|