Last active
April 4, 2018 14:20
-
-
Save ultimatemember/08c7f3369f49021cb749 to your computer and use it in GitHub Desktop.
How to stop registration using Ultimate Member action hooks
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
/* | |
You need to hook into um_submit_form_errors_hook with a | |
priority over 10. | |
You can stop registration here if the customer_code field does not | |
match the value you want "ALLOWED_VALUE" in this example | |
*/ | |
add_action('um_submit_form_errors_hook', 'check_customer_code', 100 ); | |
function check_customer_code( $args ){ | |
if ( $args['customer_code'] != 'ALLOWED_VALUE' ) { | |
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
hi,thanks for your code example. where we should put this code to work?