Arrow

Create link based on username | Peter's Login Redirect | Forum

Back to the login redirect plugin page

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Create link based on username
July 2, 2012
3:52 am
Tony
Guest

Hi, I would like to create a link at the top of my site that links back to the page that I redirected the logged-in user after they logged in. So this link would have to dynamically generate the URL based on the logged-in username, and what URL I entered into the field for their redirect rule. What's the best/easiest way to do this? I know some PHP if you can get me on the right track.

July 2, 2012
7:53 am
Peter
Admin
Forum Posts: 841
Offline

You could write a function that is similar to the rul_register() function in the plugin. Basically, it passes the current user object to the redirect_to_front_page() function to get the proper URL for the user.

July 2, 2012
11:02 am
Tony
Guest

Thanks for the quick reply. I think I figured it out based on your direction. Appreciate it.

November 5, 2012
4:59 am
Jaffa
Guest

Hi Tony

Could you share the code please? I am also trying to achieve the same thing but struggling a little. Any help would be appreciated.

Thanks

November 30, 2012
3:26 am
Sarah
Guest

Hey,

i need that too. Please share the code.

Thanks!

January 29, 2013
5:45 pm
Mark
Guest

+1 on that as well. And where do I put it please.
I've got a portfolio site with >100 users and when they log in I want them to be redirected to their own page - so they can edit it.

April 27, 2013
11:35 am
leealphen
New Member
Forum Posts: 1
Offline

Jaffa said

Hi, I would like to create a link at the top of my site that links back to the page that I redirected the logged-in user after they logged in. So this link would have to dynamically generate the URL based on the logged-in username, and what URL I entered into the field for their redirect rule. What's the best/easiest way to do this? I know some PHP if you can get me on the right track.

You've got a really great plug in here. It works well for the login sending the user to their own page. However I am not able to figure out how to bring them back to their own page after they have logged in and then gone to other pages. I tried adding a menu item or a link following your instruction "Note that you can use the syntax [variable]username[/variable] in your URLs" but cannot seem to make it work. Sorry, but my question is very basic. Do I just put this code in the url in a menu item or a link?

April 27, 2013
4:58 pm
Peter
Admin
Forum Posts: 841
Offline

Hi, I'd recommend checking out the Custom "My Portal Link" documentation at the bottom of this page: http://wordpress.org/extend/pl.....her_notes/