$data = stripcslashes($_POST['form']['dataJSON']);
$dataJS = json_decode($data, true);
echo "res: ".$dataJS['day'];
array(2) {
["action"]=>
string(11) "filter_show"
["form"]=>
array(1) {
["dataJSON"]=>
string(107) "{\"leftM\":\"0\",\"rightM\":\"54000\",\"day\":\"0\",\"people\":\"0\",\"complexity\":\"0\",\"season\":\"0\"}"
}
}
function my_acf_save_post( $post_id ) {
$file = 'wp-content/themes/storefront/php/test.txt';
$current = file_get_contents($file);
$current .= get_field('czena_tura', $post_id);
file_put_contents($file, $current);
}
function get_post_param( $post_id){
do_action( 'acf/save_post', $post_id );
}
add_action('acf/save_post', 'my_acf_save_post');
add_action( 'save_post', 'get_post_param', 10, 1 );
function get_post_param($post_id, $post_after){
$file = 'wp-content/themes/storefront/php/test.txt';
$current = file_get_contents($file);
$current .= "ID: ".$post_id.
." Start: ".$post_after->czena_tura
."\n";
file_put_contents($file, $current);
}
add_action( 'post_updated', 'get_post_param', 99, 2 );
function get_post_param($post_id, $post_after){
$file = 'wp-content/themes/storefront/php/test.txt';
$current = file_get_contents($file);
$current .= "ID: ".$post_id.
." Start: ".$post_after->nachalo_meropriyatiya
."\n";
file_put_contents($file, $current);
}
add_action( 'post_updated', 'get_post_param', 99, 2 );
add_action( 'post_updated', 'get_post_param', 99, 1 );