Solution:
If you look to the related Official Documentation linked in your question, you’ve got this snippet:
/**
* Update the order meta with field value
*/
add_action( 'woocommerce_checkout_update_order_meta', 'my_custom_checkout_field_update_order_meta' );
function my_custom_checkout_field_update_order_meta( $order_id ) {
if ( ! empty( $_POST['my_field_name'] ) ) {
update_post_meta( $order_id, 'My Field', sanitize_text_field( $_POST['my_field_name'] ) );
}
}
In your case you don’t need that as address fields are already processed by Woocommerce.
For custom special fields: The answer is yes (which is not your case)
As you can see in this code they use
sanitize_text_field()
WordPress function, when saving the submitted data to database withupdate_post_meta()
function…This is only for custom checkout fields and not for existing checkout fields, that already get their own process…