Last active
March 31, 2022 17:19
-
-
Save trueqap/43f996a976c8cef3f4be43d5a8fa95dd to your computer and use it in GitHub Desktop.
Line around 110
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($billing_fields as $field_key => $field) { | |
if (! in_array($field_key, (array) $billing_all_fields, true)) { | |
continue; | |
} | |
$function_name = 'get_' . $field_key; | |
if ($order->get_meta('_' . $field_key)) { | |
$data = $order->get_meta('_' . $field_key); | |
} else { | |
$data = $order->$function_name(); | |
} | |
woocommerce_form_field($field_key, $field, $data); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ( $billing_fields as $field_key => $field ) { | |
if ( ! in_array( $field_key, (array) $billing_all_fields, true ) ) { | |
continue; | |
} | |
$function_name = 'get_' . $field_key; | |
$data = $order->$function_name(); | |
woocommerce_form_field( $field_key, $field, $data ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($billing_fields_form as $billing_field_key => $billing_field) { | |
if (isset($_POST[ $billing_field_key ])) { | |
if ($order->get_meta('_' . $billing_field_key)) { | |
update_post_meta($order->ID, '_'. $billing_field_key, wp_unslash($_POST[ $billing_field_key ])); | |
} else { | |
call_user_func_array(array( $order, 'set_' . $billing_field_key ), array( sanitize_text_field(wp_unslash($_POST[ $billing_field_key ])) )); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
set_ is missing ;)