• Resolved Jim

    (@jwmc)


    Is there a way to add to the login widget a link to the edit-profile page when the user is logged in?
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Jim

    (@jwmc)

    I managed to find a clue in a previous answer and replaced the message when logged in as follows:

    add_filter('wppb_login_message', 'fp_change_login_message', 10, 3);
    function fp_change_login_message($logged_in_message, $user_id, $display_name){
    	$newmsg = "You are logged in as " . $display_name . "<br>";
    	$newmsg = $newmsg . "<a href='https://forestpathology.org/wp-login.php?action=logout&redirect_to=https%3A%2F%2Fforestpathology.org'>Log Out</a>";
    	$newmsg = $newmsg . "&emsp;|&emsp;" . "<a href='https://forestpathology.org/edit-profile/'>Edit Profile</a>";
    	return $newmsg;
    }

    That’s working surprisingly well, except the $display_name is not showing as the selected display name, it is the user name. The correct display name shows in the back end and in Profile Builder’s Edit Profile page.

    Thanks

    Plugin Author Georgian Cocora

    (@raster02)

    Hello @jwmc,

    You have the $user_id in that function, you can use it to get the name you want and use that instead of $display_name.

    Regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘link to edit profile in the login widget?’ is closed to new replies.