Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: registration validation

@ottolini

Participant

I was able to implement validation, creating a hook on bp_signup_pre_validate, with something like that:


function myplugin_bp_signup_pre_validate() {
  global $bp;

  if (!myvalidationfunction($_POST['field_XX'])) {
    $bp->signup->errors['field_XX'] = 'My validation error message';
  }
}

add_action ('bp_signup_pre_validate', 'myplugin_bp_signup_pre_validate', 20);

Obviously you have to use the correct number for the field(s) you want to validate instead of “XX”: look at the code of the page to identify the correct name of your XProfile field(s).

Skip to toolbar