Code-Snippets-Functions/Execute a function on a child site/WooCommerce/remove-first-zero-phone-number-after-registration.txt

5 lines
214 B
Text

function removezero( $user_id ) {
if (isset($_POST['billing_phone'])) {
update_user_meta( $user_id, 'billing_phone', $_POST['billing_phone'] = preg_replace('/^0/', '', $_POST['billing_phone']));
}
}