Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: user_registration_email

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
206      if ( FALSE == get_option('users_can_register') ) {
207           wp_redirect('wp-login.php?registration=disabled');
208           exit();
209      }
210
211      if ( $_POST ) {
212           require_once( ABSPATH . WPINC . '/registration.php');
213
214           $user_login = sanitize_user( $_POST['user_login'] );
215           $user_email = apply_filters( 'user_registration_email', $_POST['user_email'] ); 
216
217           // Check the username
218           if ( $user_login == '' )
219                $errors['user_login'] = __('<strong>ERROR</strong>: Please enter a username.');
220           elseif ( !validate_username( $user_login ) ) {
221                $errors['user_login'] = __('<strong>ERROR</strong>: This username is invalid.  Please enter a valid username.');
222                $user_login = '';
223           } elseif ( username_exists( $user_login ) )
224                $errors['user_login'] = __('<strong>ERROR</strong>: This username is already registered, please choose another one.');