I am using ACF as a ‘frontend form generator’. I need to get credit card information, but I cannot save it on database at all. I’ll just get the post data and send it to a external API.
So, how do I block certain fields to get saved on database? Is it possible?
You need to delete the value from $_POST['acf']
before ACF saves the value.
This means either an acf/pre_save_post filter or an acf/save_post filter with a priority < 10.
after doing what you need to do with the value
unset($_POST['acf']['field_123456']); // or whatever your field key is
I solved it this way:
add_filter( 'acf/update_value/name=card_number', '__return_null' );