-
-
Save pippinsplugins/eea1456fe9254c5b10ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Determines if there are problems with the registration data submitted | |
* | |
*/ | |
function pw_rcp_validate_user_fields_on_register( $posted ) { | |
if ( is_user_logged_in() ) { | |
return; | |
} | |
if( empty( $posted['rcp_profession'] ) ) { | |
rcp_errors()->add( 'invalid_profession', __( 'Please enter your profession', 'rcp' ), 'register' ); | |
} | |
if( empty( $posted['rcp_location'] ) ) { | |
rcp_errors()->add( 'invalid_location', __( 'Please enter your location', 'rcp' ), 'register' ); | |
} | |
} | |
add_action( 'rcp_form_errors', 'pw_rcp_validate_user_fields_on_register', 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment