Each user is redirected to his personal Page!
-
I am a beginner with php…
Is possible that after the registration is automatically created a page that is visible only to the user and admin? I need to load for each user personal documents that no one else can see.This code automatically creates a page for each registered user:
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['comment_status'] = 'closed'; $my_post['post_content'] = 'Welcome, this is your private page'; $my_post['post_status'] = 'publish'; wp_insert_post( $my_post ); } add_action('user_register', 'my_create_page');
How to make these pages visible only to the specific user and the admin?
Thanks,
Giovanni
- The topic ‘Each user is redirected to his personal Page!’ is closed to new replies.