Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function add_user_custom_meta($user_id) {
- $user_info=get_userdata( $user_id );
- if ( isset( $_POST['first_name'] ) )
- update_user_meta($user_id, 'first_name', $_POST['first_name']);
- if ( isset( $_POST['last_name'] ) )
- update_user_meta($user_id, 'last_name', $_POST['last_name']);
- wp_mail($user_info->user_email, 'User first and last name', sprintf('Hi we have added your first name :-% and last name:- % to our site.',$_POST['first_name'],$_POST['last_name'])); }require('wordpress/wp-blog-header.php');
- $user_email = trim(isset($_POST['payer_email']) ? $_POST['payer_email'] : "");
- $user_name = trim(isset($_POST['first_name']) ? $_POST['first_name'] : "");
- $user_id = username_exists( $user_name );
- if ( !$user_id ) {
- $random_password = wp_generate_password( 12, false );
- $user_id = wp_create_user( $user_name, $random_password, $user_email );} else {
- $random_password = __('User already exists. Password inherited.'); }add_action('user_register', 'add_user_custom_meta');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement