Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to create a link redirecting to forum profile user ?

  • @vegas778

    Participant

    Hi All,

    I would like to create a link in a wordpress widget that redirects the logged in user to his user forum profile page but I cannot manage… I dont know what code should I use.

    Example : it should redirects to the page : http://www.example.org/forums/user/admin/

    Thanks in advance

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • @robkk

    Moderator

    you could add a link to the login widget , but you have to do this every upgrade.

    if you dont want to do that there is also 2 other solutions to this too in the link

    Layout and functionality – Examples you can use

    @vegas778

    Participant

    This link is not working : <p><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>edit" >Amend Profile/Change password</a></p>

    I dont know which link should I add in the widget to redirect to this pages for users : http://www.example.org/forums/user/admin/

    @vegas778

    Participant

    Ha yes this link is working : <a class="bbp-profile-button" href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>">Profile Settings</a>

    But I think my plugin user meta does not accept php code that is why it is not working. The only way is with a php code to create a bbpress profile link ?

    @robkk

    Moderator

    The only way is with a php code to create a bbpress profile link ?

    well maybe if you have a shortcode to display the users “login name” then you could probably replace the the php code with the shortcode. idk if it works though havent really tried anything like that just yet.

    alternative is allow php in widgets, which is unsafe.

    and also you could a link to profile in your menu.

    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu) {  
        if (!is_user_logged_in())
            return $menu;
        else
            $current_user = wp_get_current_user();
            $user=$current_user->user_login ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/">View Profile</a></li>';
            $menu = $menu . $profilelink;
            return $menu;
         
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar