Sidebar Login
sing %username% in redirect? (8 posts)

  1. jgclifton
    Posted 2 years ago #

    Is this possible? it doesn't seem to be working for me.

    If anyone knows a way to make this work it would be much appreciated.


  2. WouterSe
    Posted 2 years ago #

    I have the same question:
    is it possoble after login to redirect to the persons personal page (referred to with his username, e.g. Walter) with
    http://www.mydomainname.com/%username% ?

  3. mgkoller
    Posted 2 years ago #

    Sorry to hijack this thread but I think my problem relates.
    I'm using the Sidebar login Widget in Buddypress, I would like to redirect the Dashboard and Profile links to "members/USERNAME/" and "members/username/profile/" So I need to change
    Links (Text | HREF | Capability):

    Dashboard | %admin_url%
    Profile | %admin_url%/profile.php
    Logout | %logout_url%

    I don't know what these Buddypress %username% functions are called. Any ideas?

  4. zircle
    Posted 2 years ago #

    @jgclifton and WouterSe, in the "Login Redirect Url", simply add this:


    Due to the nature of sessions, they will automatically redirect to their profile page when logged in.

    @mgkoller, I don't use buddypress atm, but if I'll take a look at it when I have the change.

  5. strangerrj
    Posted 2 years ago #

    hi @mgkoller,

    I had it on my site, but I have BB Press deleted.

    I had exactly the same:


    or vice versa, I do not remember:



    (I hope I got it right out of you, my English is not so good.)

  6. inveress
    Posted 2 years ago #

    In regards to the original question, not the BB-related issue, I think I use the solution you're after. I wanted to be able to redirect to a page based on the user's login name, not the displayed username.
    I had to edit the plugin, though.

    Edit the file sidebar-login/includes/class-sidebar-login-widget.php.
    You need to change the first part of the replace_tags() function:

    public function replace_tags( $text ) {
        if ( $this->user ) {
            $text = str_replace(
                array( '%username%', '%userid%', '%userlogin%' ),
                array( ucwords( $this->user->display_name ), $this->user->ID, $this->user->user_login ),

    And then use the %userlogin% tag in your widget.

    Hope this helps someone!

  7. afranklin2
    Posted 2 years ago #

    The problem is, since I updated, the URL does not resolve correctly for usernames that contain a space. It used to insert the dash needed, but not since I updated! How do I fix this? Is there a tag to use now other than %username% in URLs?

  8. rezwiebel
    Posted 1 year ago #

    The problem is, that the plugin vendor uses

    array( ucwords( $this->user->display_name ), $this->user->ID ),

    in line 105 in class-sidebar-login-widget.php

    It works when you replace it with

    array( ucwords( $this->user->user_login ), $this->user->ID ),

    It's a hack. But the only solution i found so far. Maybe the programmer could provide a new version to fix this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Sidebar Login
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.