• I wanted to use the user’s login name (‘fredsmith’) to create custom URLs but the plugin doesn’t seem to support it – am I missing something?

    I added the functionality myself by editing /includes/class-sidebar-login-widget.php and changing the replace_tags function:

    From line 99:

    $text = str_replace(
    	array( '%username%', '%userid%', '%userlogin%', '%firstname%', '%lastname%', '%name%' ),
    	array(
    		ucwords( $this->user->display_name ),
    		$this->user->ID,
    		$this->user->user_login,
    		$this->user->first_name,
    		$this->user->last_name,
    		trim( $this->user->first_name . ' ' . $this->user->last_name )
    	),
        	$text
    );

    Now you can use %userlogin% to use the user’s login.

    This is in plugin version 2.7.2.

    Peter.

    https://wordpress.org/plugins/sidebar-login/

Viewing 1 replies (of 1 total)
  • very nice!
    I’d like the same thing, but width the nickname variable.
    This variable is in the wp_usermeta table.
    How can I add this?

Viewing 1 replies (of 1 total)
  • The topic ‘%userlogin% functionality’ is closed to new replies.