| 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')|| ($current_user->ID && $current_user->has_cap('wppm_admin')))) {exit;} |
| 8 |
ob_start(); |
| 9 |
?> |
| 10 |
<div class="form-group"> |
| 11 |
<label for="wppm_cat_name"><?php echo esc_html_e('Category Name','taskbuilder');?></label> |
| 12 |
<p class="help-block"><?php echo esc_html_e('Insert category name. Please make sure category name you are entering should not already exist.','taskbuilder');?></p> |
| 13 |
<input id="wppm_cat_name" class="form-control" name="wppm_cat_name" value="" /> |
| 14 |
</div> |
| 15 |
<input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_add_category' ) ); ?>"> |
| 16 |
<?php |
| 17 |
$body = ob_get_clean(); |
| 18 |
ob_start(); |
| 19 |
?> |
| 20 |
<button type="button" class="btn wppm_popup_close" onclick="wppm_modal_close();"><?php echo esc_html_e('Close','taskbuilder');?></button> |
| 21 |
<button type="button" class="btn wppm_popup_action" onclick="wppm_set_add_category();"><?php echo esc_html_e('Submit','taskbuilder');?></button> |
| 22 |
<?php |
| 23 |
$footer = ob_get_clean(); |
| 24 |
$output = array( |
| 25 |
'body' => $body, |
| 26 |
'footer' => $footer |
| 27 |
); |
| 28 |
echo wp_json_encode($output); |
| 29 |
|