Write extra field in the Woocommerce user registry

0

I need to put in order for Woocommerce to write some new fields that I inserted into the user profile, I am using the code below without success, so I see that the hook is not informed, the file I am using has this action at the beginning :

do_action( 'woocommerce_before_edit_account_form' );

The code I'm trying to use is this:

   add_action ( 'edit_user_profile_update', 'user_profile_extra_fields_marketplace' );

function user_profile_extra_fields_marketplace( $user_id ){
    if ( isset($_POST['bairro_wk']) ) {
        update_user_meta( $user_id, 'bairro_wk', sanitize_text_field($_POST['bairro_wk']) );
    }
}
    
asked by anonymous 12.09.2018 / 15:35

0 answers