Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_user_login

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
133                $add_user_errors = $user_details[ 'errors' ];
134           } else {
135                /**
136                 * Filters the user_login, also known as the username, before it is added to the site.
137                 *
138                 * @since 2.0.3
139                 *
140                 * @param string $user_login The sanitized username.
141                 */
142                $new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) );
143                if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'manage_network_users' ) ) {
144                     add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email
145                     add_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email
146                }
147                wpmu_signup_user( $new_user_login, $new_user_email, array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST['role'] ) );
148                if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'manage_network_users' ) ) {
149                     $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) );
150                     $new_user = wpmu_activate_signup( $key );
151                     if ( is_wp_error( $new_user ) ) {