Possible to set the password of a page to the users password automatically?
-
I’ve got a custom wordpress install where when a user signs up, a new page is created automatically. I’d like for that page to also be password protected, but want the password to be assigned as the password that gets defined when the user signs up. Here is the code for the automatic page creation when a user signs up..
function my_create_page($user_id){
$the_user = get_userdata($user_id);
$new_user_name = $the_user->user_login;
$my_post = array();
$my_post[‘post_title’] = $new_user_name;
$my_post[‘post_type’] = ‘page’;
$my_post[‘post_content’] = ‘Hi User[userupdates]
[tab:BACKLINKS-ELGG] [table id=2 /]
[tab:BACKLINKS-ARTICLE]
[tab:END] Some more info goes here
‘;
$my_post[‘post_status’] = ‘publish’;wp_insert_post( $my_post );
}
add_action(‘user_register’, ‘my_create_page’);Any ideas on what I could use to set the password as the users own password for that new page?
The topic ‘Possible to set the password of a page to the users password automatically?’ is closed to new replies.