Support

Account

Home Forums Front-end Issues acf_form on user profile Reply To: acf_form on user profile

  • This is my solution that saves the value.

    add_action( 'woocommerce_edit_account_form', 'add_favorite_color_to_edit_account_form' );
    function add_favorite_color_to_edit_account_form() {
        acf_form_head();
    
        $current_user = wp_get_current_user();
    	$options = array(
    		    'post_id' => 'user_'.$current_user->ID,
    		    'field_groups' => array(111),
    		    'form' => true, 
    		    'return' => add_query_arg( 'updated', 'true', get_permalink() ), 
    		    'html_before_fields' => '',
    		    'html_after_fields' => '',
    		    'submit_value' => 'Update' 
    		);
    		acf_form( $options );
    }