Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.