So, the total code should appear as this:
/***************** 1st part: prevent saving *********************/
/**
* Reset the ACF Array before it saves postmeta
* Priority 5 is Before Save, 10+ After Save
*
* @return void
*/
function acf_account_fields_save_prevention() {
if( is_admin() || ! isset( $_POST[‘woocommerce-register-nonce’] ) || empty( $_POST[‘acf’] ) ) {
return;
}
$_POST[‘acf’] = array();
}
add_action( ‘acf/save_post’, ‘acf_account_fields_save_prevention’, 5 );
/**************** 2nd part: cleanup the form (for double checking and security ******************/
/**
* Clean up the woocommerce registration form in case it is pre-populated
* @return void
**/
add_action( ‘woocommerce_register_form’, ‘acf_account_fields_clean_data_on_registrationform’);
function acf_account_fields_clean_data_on_registrationform() {
//here I need to write the code to clean the population form.
//I’ve tried with no success, any hint?
}
so for a complete solution just the php for cleaning the code is missing.