$date = date(‘Y-m-d H:i:s’);

$status = true;

$userdata = array(

‘user_login’=>$email,

‘user_email’=>$email,

‘user_registered’=>$date,

‘display_name’=>$name,

‘role’=>’subscriber’,

‘user_pass’=> $pass

);

$inserted_id = wp_insert_user( $userdata );

if( sizeof($inserted_id->errors)>0 )

{

print_r($inserted_id->errors);

//wp_redirect(home_url());

exit;

}

wp_set_password( $pass, $inserted_id);

if( $age != ”){

update_user_meta( $inserted_id , ‘age’, $age);

}

One Comment

  • Thanks for one’s marvelous posting! I genuinely enjoyed reading it, you could be a great author.I will be sure to bookmark your blog and definitely will come back later in life. I want to encourage that you continue your great job, have a nice morning!

Leave a Reply