Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AngeliMae/da0be5c02367d9cc6a0d2bdc619c8639 to your computer and use it in GitHub Desktop.

Select an option

Save AngeliMae/da0be5c02367d9cc6a0d2bdc619c8639 to your computer and use it in GitHub Desktop.
Stop registration if customer_code field does not equal ABCDE
add_action( 'um_submit_form_errors_hook', 'check_customer_code', 100, 1 );
function check_customer_code( $args ){
if ( isset( $args['customer_code'] ) && $args['customer_code'] != 'ABCDE' ) {
UM()->form()->add_error( 'customer_code', 'Please put in the correcct passcode' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment