Redirect after login
-
Not familiar with changing plugin code, as I don’t wish to cause any errors. Love the plugin, just simple and perfect.
I’m just trying to redirect user from edit profile to that last page they viewed. Any suggestion so I don’t have to add more plugins.
-
Dear @jgbones, there are two ways a) you can edit by yourselft by editing at line 247 of clean-login.php or b) contact us at contacto(at)codection.com to implement this feature for you.
Many thanks for your comment.
Alberto.
I also would like to redirect user after login to a special page. I placed the complete url at line 247 (wp_safe_redirect( $url ); ), but nothing happenend. What went wrong?
Could you paste your edited line below?
Any news?
Hi, I would like the answer to this too please. Could you please tell me what the line would look like to either redirect to homepage/specific page or the page that was logged in from.
Thanks
Hi Tasty Badger,
Line 247.
Please rate our support here: http://wordpress.org/support/view/plugin-reviews/clean-login
Alberto.
Hi Alberto, Thanks for your response but would you mind being a bit more specific, I have only just begun to edit plugins…
The text that needs to be edited is – if I am correct? – the last line of the following:
// LOGIN
if ( isset( $_REQUEST[‘action’] ) && $_REQUEST[‘action’] == ‘login’ ) {
$login_url = get_option( ‘cl_login_url’, ”);
if ( $login_url != ” )
$url = $login_url;
$user = wp_signon();
if ( is_wp_error( $user ) )
$url = add_query_arg( ‘authentication’, ‘failed’, $url );
else
$url = add_query_arg( ‘authentication’, ‘success’, $url );wp_safe_redirect( $url );
Please could you tell me exactly what I would need to write to redirect to a specific page or original page.
Your help is much appreciated.
Hi Tasty Badger,
In fact, you have for ways to modify it.
a) change the url in the last line, but you will lose the control if an user is authenticate or not because the plugin cannot manage external pages.
b) modify each “add_query_arg” by a “wp_safe_redirect” to a custom page depending of the authentication.
c) write me an email to contacto(at)codection.com and I can code for you in your website. Less than an hour.
d) we can update our plugin to include this feature, but as c) means cost. Our time in our company has a value. 2 hours. Price per hour can be detailed by email.
And please, don’t forget to rate our quick support. Many threads resolved quickly but no rating by our users http://wordpress.org/support/view/plugin-reviews/clean-login
Regards,
Alberto.
Hi Tasty Badger, any news?
Would it be possible to implement this as a feature that can be configured in the clean-login settings?
“After login, forward to page: xxx” after “yy” seconds.Hi bdbeer,
This feature is not currently included. But of course, if you need it you can support the development. contacto(at)codection(dot)com
Regards,
Alberto.
If only I knew how to code (well), I would love to contribute.
Would this be the correct syntax?
if ( is_wp_error( $user ) )
$url = add_query_arg( ‘authentication’, ‘failed’, $url );
else
$url = add_query_arg( ‘authentication’, ‘success’, http://mywebsite.here.com );wp_safe_redirect( $url );
Yes, it is, but use single-quotes in the las parameter (URL)
Alberto.
if ( is_wp_error( $user ) )
$url = add_query_arg( ‘authentication’, ‘failed’, $url );
else
$url = add_query_arg( ‘authentication’, ‘success’, ‘http://mywebsite.here.com’ );wp_safe_redirect( $url );
So like this?
How would I add a short delay in there? So users would see “authentication succeeded” for a couple of seconds?
The topic ‘Redirect after login’ is closed to new replies.