Skip Navigation

[Resolved] How to modify login URL with Toolset's login form?

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by StanleyT8485 5 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1329771

Tell us what you are trying to do? I want to modify login URL with Toolset's login form.

When the login form has an error from either an incorrect password or an invalid email, it will add &fail_reason=invalid_email or wrong password.

I want to add a #loginx at the end of the URL.

For example, hidden link

What is the link to your site? hidden link

#1330091

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I searched for the WordPress hook that supports the unsuccessfully login action and I found that there is a hook namely "wp_login_failed":

More info:
=> hidden link
=> https://wordpress.stackexchange.com/questions/15633/how-can-i-redirect-user-after-entering-wrong-password

Can you please try to use that and check if that help you to resolve your issue.

#1331097
add_action( 'wp_login_failed', 'my_front_end_login_fail' );  // hook failed login

function my_front_end_login_fail( $username ) {
   $referrer = $_SERVER['HTTP_REFERER'];  // where did the post submission come from?
   // if there's a valid referrer, and it's not the default log-in screen
   if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) {
      wp_redirect( $referrer . '?login=failed' );  // let's append some information (login=failed) to the URL for the theme to use
      exit;
   }
}

I used this code and it didn't work.

My login form isn't wp-login or wp-admin, it is placed on our product pages. So each product on our website has a login form on their page.

#1331111

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share problem URL and access details.

I have set the next reply to private which means only you and I have access to it.

#1331155

Here is an example of a product page - hidden link

You can access the login form on that page directly via hidden link

Btw, the login form is an accordion.

Test email is bb20@gmail.com.

#1331243

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share wp-admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1332085

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've added the "redirect_url_fail" attribute to your page:

[wpv-login-form redirect_url_fail="/product/feather-flags/#loginx" redirect_url="/product/feather-flags/?login=success" allow_remember="true" remember_default="true"]

I can see its working now. Can you please confirm.

More info:
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-login-form

#1332099

Thanks! That worked!

Is that a default function of the Toolset's login form?

Another question, how do you change the error message of the login form?

Stan

New threads created by Minesh and linked to this one are listed below:

https://toolset.com/forums/topic/split-how-to-modify-login-url-with-toolsets-login-form/

#1332101

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - the attribute "redirect_url_fail" is available with [wpv-login-form]. Please check the following Doc.

More info:
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-login-form

I split the ticket with your new question. Please mark this resolved 🙂

#1332105

My issue is resolved now. Thank you!