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 |
|---|---|
| 2252 | * If any errors are present in $errors, this will abort the user's registration. |
| 2253 | * |
| 2254 | * @since 2.1.0 |
| 2255 | * |
| 2256 | * @param WP_Error $errors A WP_Error object containing any errors encountered |
| 2257 | * during registration. |
| 2258 | * @param string $sanitized_user_login User's username after it has been sanitized. |
| 2259 | * @param string $user_email User's email. |
| 2260 | */ |
| 2261 | $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email ); |
| 2262 | |
| 2263 | if ( $errors->get_error_code() ) |
| 2264 | return $errors; |
| 2265 | |
| 2266 | $user_pass = wp_generate_password( 12, false ); |
| 2267 | $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email ); |
| 2268 | if ( ! $user_id || is_wp_error( $user_id ) ) { |
| 2269 | $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) ); |
| 2270 | return $errors; |