'tc_content',
'textarea_rows' => 12,
'media_buttons' => true,
'teeny' => false,
'quicktags' => true
)
);
?>
__('Invalid security token or Insufficient permissions.', 'abp-transport-booking'), 'type' => 'warn'], 403);
}
$post_html = fn($key, $default = '') => isset($_POST[$key]) ? wp_kses_post(wp_unslash($_POST[$key])) : $default;
update_option('abptb_tc', $post_html('tc_content'));
ob_start();
$this->tc_config();
$html = ob_get_clean();
wp_send_json_success([
'html' => $html,
'msg' => __('Term & Conditions Saved Successfully..... !!', 'abp-transport-booking'),
'type' => 'success'
]);
}
public function import_tc_content(): void {
if (!check_ajax_referer('abptb_admin_ajax_nonce', 'nonce', false) || !current_user_can('manage_options')) {
wp_send_json_error(['msg' => __('Invalid security token or Insufficient permissions.', 'abp-transport-booking'), 'type' => 'warn'], 403);
}
$tcs = ABPTB_Function::get_option('abptb_tc', '');
ob_start();
$this->tc($tcs);
$html_content = ob_get_clean();
wp_send_json_success(['html' => $html_content, 'msg' => __('Global Term & Conditions Imported Successfully ..... !! ', 'abp-transport-booking'), 'type' => 'success']);
}
}
new ABPTB_TC();
}