
<center><h2><strong>Ubuntu</strong></h2>
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php

if (! defined('ABSPATH') ) {
	exit;
}

$_nonce = isset($_POST['afadv-fields-nonce-field']) ? sanitize_text_field(wp_unslash($_POST['afadv-fields-nonce-field'])) : 0;

if (isset($_POST['afadv-fields-nonce-field']) && ! wp_verify_nonce($_nonce, 'afadv_fields_nonce_action') ) {
	die('Failed Security Check');
}

// Save Data

if (isset($_POST['afadv_rule_priority']) ) {
	wp_update_post(
		array(
			'ID'         => intval($post_id),
			'menu_order' => sanitize_text_field(wp_unslash($_POST['afadv_rule_priority'])),
		)
	);
}

if (isset($_POST['afadv_bulk_min_qnt_fld']) ) {
	update_post_meta($post_id, 'afadv_bulk_min_qnt_fld', sanitize_text_field(wp_unslash($_POST['afadv_bulk_min_qnt_fld'])));
}

if (isset($_POST['afadv_quantity_type']) ) {
	update_post_meta($post_id, 'afadv_quantity_type', sanitize_text_field(wp_unslash($_POST['afadv_quantity_type'])));
}

if (isset($_POST['afadv_bulk_custom_qnt_fld']) ) {
	update_post_meta($post_id, 'afadv_bulk_custom_qnt_fld', sanitize_text_field(wp_unslash($_POST['afadv_bulk_custom_qnt_fld'])));
}

if (isset($_POST['afadv_decimal_step']) ) {
	update_post_meta($post_id, 'afadv_decimal_step', sanitize_text_field(wp_unslash($_POST['afadv_decimal_step'])));
}

if (isset($_POST['afadv_bulk_max_qnt_fld']) ) {
	update_post_meta($post_id, 'afadv_bulk_max_qnt_fld', sanitize_text_field(wp_unslash($_POST['afadv_bulk_max_qnt_fld'])));
}

if (isset($_POST['afadv_bulk_steps_qnt_fld']) ) {
	update_post_meta($post_id, 'afadv_bulk_steps_qnt_fld', sanitize_text_field(wp_unslash($_POST['afadv_bulk_steps_qnt_fld'])));
}

if (isset($_POST['afadv_bulk_fixed_qnt_fld']) ) {
	update_post_meta($post_id, 'afadv_bulk_fixed_qnt_fld', sanitize_text_field(wp_unslash($_POST['afadv_bulk_fixed_qnt_fld'])));
}

if (isset($_POST['afadv_display_dropdown']) ) {
	update_post_meta($post_id, 'afadv_display_dropdown', sanitize_text_field(wp_unslash($_POST['afadv_display_dropdown'])));
} else {
	update_post_meta($post_id, 'afadv_display_dropdown', 'no');
}

if (isset($_POST['afadv_apply_on_all_products']) ) {
	update_post_meta($post_id, 'afadv_apply_on_all_products', sanitize_text_field(wp_unslash($_POST['afadv_apply_on_all_products'])));
} else {
	update_post_meta($post_id, 'afadv_apply_on_all_products', sanitize_text_field('no'));
}

if (isset($_POST['afadv_bulk_spec_pro_fld']) ) {
	update_post_meta($post_id, 'afadv_bulk_spec_pro_fld', sanitize_meta('', wp_unslash($_POST['afadv_bulk_spec_pro_fld']), '') );
} else {
	update_post_meta($post_id, 'afadv_bulk_spec_pro_fld', array() );
}

if (isset($_POST['afadv_bulk_spec_cat_fld']) ) {
	update_post_meta($post_id, 'afadv_bulk_spec_cat_fld', sanitize_meta('', wp_unslash($_POST['afadv_bulk_spec_cat_fld']), '') );
} else {
	update_post_meta($post_id, 'afadv_bulk_spec_cat_fld', array());
}

if (isset($_POST['afadv_bulk_rest_role_fld']) ) {
	update_post_meta($post_id, 'afadv_bulk_rest_role_fld', wp_json_encode(sanitize_meta('', wp_unslash($_POST['afadv_bulk_rest_role_fld']), '')));
} else {
	update_post_meta($post_id, 'afadv_bulk_rest_role_fld', wp_json_encode(array()));
}
