Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function tml_registration_errors( $errors ) {
- if ( empty( $_POST['country'] ) )
- $errors->add( 'empty_country', '<strong>ERROR</strong>: Please enter your country.' );
- return $errors;
- }
- add_filter( 'registration_errors', 'tml_registration_errors' );
- function tml_user_register( $user_id ) {
- if ( !empty( $_POST['country'] ) )
- update_user_meta( $user_id, 'country', $_POST['country'] );
- }
- add_action( 'user_register', 'tml_user_register' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement