WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
208 | if ( FALSE == get_option('users_can_register') ) { |
209 | wp_redirect('wp-login.php?registration=disabled'); |
210 | exit(); |
211 | } |
212 |
|
213 | if ( $_POST ) { |
214 | require_once( ABSPATH . WPINC . '/registration.php'); |
215 |
|
216 | $user_login = sanitize_user( $_POST['user_login'] ); |
217 | $user_email = apply_filters( 'user_registration_email', $_POST['user_email'] ); |
218 |
|
219 | // Check the username |
220 | if ( $user_login == '' ) |
221 | $errors['user_login'] = __('<strong>ERROR</strong>: Please enter a username.'); |
222 | elseif ( !validate_username( $user_login ) ) { |
223 | $errors['user_login'] = __('<strong>ERROR</strong>: This username is invalid. Please enter a valid username.'); |
224 | $user_login = ''; |
225 | } elseif ( username_exists( $user_login ) ) |
226 | $errors['user_login'] = __('<strong>ERROR</strong>: This username is already registered, please choose another one.'); |