Hi every one
how can i unset field to prevent it from saving
this is my code not working!
function my_acf_save_post( $post_id ) {
if( empty($_POST[‘acf’]) ) {
return;
}
$fields = $_POST[‘acf’];
unset($fields[‘field_5964d52f052b7’]);
return $fields;
}
add_action(‘acf/save_post’, ‘my_acf_save_post’, 1);
if (isset($_POST['acf']) && isset($_POST['acf']['field_5964d52f052b7'])) {
unset($_POST['acf']['field_5964d52f052b7']);
}