Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#5379 closed enhancement (fixed)

add earlier hook in bp_core_screen_signup() *before* validation checks

Reported by: terraling Owned by: boonebgorges
Priority: normal Milestone: 2.0
Component: Core Version:
Severity: normal Keywords:
Cc:

Description

There is an existing action hook called bp_signup_validate in bp_core_screen_signup() which comes *after* all of the WP and BP validation checks.

Can we please insert

do_action( 'bp_signup_prevalidate' );

in bp_core_screen_signup() at line 82 of bp-member-screens.php to allow intervention *before* the validation checks?

(My use case is to improve the mobile experience by making it possible to bypass requiring the user to enter the password twice. Leaving #submit_password_confirm hidden and empty on the client also makes for a nice honeypot.)

Attachments (1)

bp-members-screens.php​ (19.7 KB ) - added by terraling 13 years ago.

Download all attachments as: .zip

Change History (4)

#1 @boonebgorges
13 years ago

  • Milestone Awaiting Review → 2.0

If you want to modify the signup validation that BuddyPress does, I'd recommend filtering 'bp_core_validate_user_signup', and setting/unsetting error messages. With the hook you've requested, I imagine you'd have to do something kinda hackish (like messing with the $_POST global) to work around our validation.

That said, there are legit reasons for wanting this hook, and it's harmless to add it. I'm going to tweak the name to fit better with our naming conventions. Thanks for the suggestion!

#2 @boonebgorges
13 years ago

  • Owner set to boonebgorges
  • Resolution → fixed
  • Status new → closed

In 7824:

Add bp_signup_pre_validate hook

Allows plugins to modify signups before validation takes place.

Fixes #5379

Props terraling

#3 @terraling
13 years ago

That was quick, thanks!

I somehow missed the chance to filter 'bp_core_validate_user_signup', but adding a specific action hook is more explicit.

Note: See TracTickets for help on using tickets.