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 |
|---|---|
| 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.'); |