pre_user_login

pre_user_login

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.5.2

apply_filters('pre_user_login') is found 2 times:

  • /wp-admin/user-new.php line 216
    		if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) {
    			$add_user_errors = $user_details['errors'];
    		} else {
    			/** This filter is documented in wp-includes/user.php */
    			$new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) );
    			if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) {
    				add_filter( 'wpmu_signup_user_notification', '__return_false' );  // Disable confirmation email.
    				add_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email.
    			}
    			wpmu_signup_user(
    				$new_user_login,
    
  • /wp-includes/user.php line 2121
    	 * @since 2.0.3
    	 *
    	 * @param string $sanitized_user_login Username after it has been sanitized.
    	 */
    	$pre_user_login = apply_filters( 'pre_user_login', $sanitized_user_login );
    
    	// Remove any non-printable chars from the login string to see if we have ended up with an empty username.
    	$user_login = trim( $pre_user_login );
    
    	// user_login must be between 0 and 60 characters.
    	if ( empty( $user_login ) ) {