Skip to content

Instantly share code, notes, and snippets.

@ultimatemember
Last active February 28, 2018 15:59
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ultimatemember/296161825d8127fa28fc to your computer and use it in GitHub Desktop.
Save ultimatemember/296161825d8127fa28fc 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 );
function check_customer_code( $args ){
if ( isset( $args['customer_code'] ) && $args['customer_code'] != 'ABCDE' )
exit( wp_redirect( add_query_arg('err', 'invalid_customer_code') ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment