I am trying to automatically populate/set the "Website" under Contact Information in user profiles at registration time. I want the URL to go to their Author Archives page (i.e., http://mywordpresssite.com/author/Tom/)
I am using the Paid Memberships Pro plugin for registration. I am also using Theme My Login if that makes any difference, but not for registration.
The code below doesn't work because it seems that the URL for the author posts hasn't been created yet. I have tried so many different things and now I'm stumped!
function change_user_url($user_id) {
global $user_login;
get_currentuserinfo();
$display_name = $user_login;
$website = get_author_posts_url();
$website = $website . $display_name;
wp_update_user( array( 'ID' => $user_id, 'user_url' => $website ) );
}
add_action('user_register', 'change_user_url');