Last active
August 9, 2016 11:55
Star
You must be signed in to star a gist
This file contains 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 | |
/* | |
Plugin Name: Autofill users info at checkout | |
*/ | |
function autofill_users_info_at_checkout_update_mata( $user_id ) { | |
add_user_meta($user_id, 'billing_phone', '0123456789'); | |
} | |
add_action( 'user_register', 'autofill_users_info_at_checkout_update_mata', 10, 1 ); |
This file contains 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 | |
/* | |
Plugin Name: Autofill users info at checkout | |
*/ | |
function autofill_users_info_at_checkout_update_mata( $user_id ) { | |
// First attempt | |
update_user_meta($user_id, 'billing_phone', $_POST['user_login']); | |
// Second attempt | |
update_user_meta($user_id, 'billing_phone', get_user_meta( $user_id, 'user_login', true)); | |
} | |
add_action( 'user_register', 'autofill_users_info_at_checkout_update_mata', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment