cuny-academic-commons / cbox-theme

Default theme for Commons In A Box
GNU General Public License v2.0
20 stars 15 forks source link

Change button ID on registration page #269

Closed r-a-y closed 3 years ago

r-a-y commented 3 years ago

A follow-up to https://github.com/cuny-academic-commons/cbox-theme/issues/268#issuecomment-662281319:

One minor thing to note is a change to the submit button ID on the registration page. WP's password strength JS looks for a button ID of 'submit' or 'wp-submit' to ensure that if a weak password is entered, it will require the user's confirmation before the form can be submitted:

https://github.com/WordPress/WordPress/blob/e82a76b282c02121bf0f970cde96a1f523f9fac7/wp-admin/js/user-profile.js#L106

So I've changed the button ID on the registration page from 'signup_submit' to 'submit'. This shouldn't break anything unless a plugin has altered their registration page to rely on the #signup_submit ID (I'm thinking of a JS selector listener). If that's the case, it should be a simple one-line fix. Noted for future reference for anyone who stumbles upon this.

I ran into an issue integrating reCAPTCHA on the registration page due to the button ID being named 'submit': https://stackoverflow.com/a/42860847

So I'm going to change the button ID from 'submit' to 'wp-submit'. This allows us to keep the WP password strength meter, while allowing custom implementations of reCAPTCHA (and potentially other scripts) to work on the registration page.