WordPress.org

Make WordPress Core

Changeset 52091


Ignore:
Timestamp:
11/09/2021 11:46:09 PM (2 months ago)
Author:
davidbaumwald
Message:

Login and Registration: Pass $errors parameter to registration_redirect filter.

On user registration, the $errors variable is the result of register_new_user which contains either the newly registered user's ID on success or a WP_Error object on failure. This change passes that context to the registration_redirect filter.

Props Collizo4sky, aadilali, mukesh27, audrasjb.
Fixes #53992.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r52060 r52091  
    10411041         *
    10421042         * @since 3.0.0
    1043          *
    1044          * @param string $registration_redirect The redirect destination URL.
     1043         * @since 5.9.0 Added the `$errors` parameter.
     1044         *
     1045         * @param string       $registration_redirect The redirect destination URL.
     1046         * @param int|WP_Error $errors                User id if registration was successful,
     1047         *                                            WP_Error object otherwise.
    10451048         */
    1046         $redirect_to = apply_filters( 'registration_redirect', $registration_redirect );
     1049        $redirect_to = apply_filters( 'registration_redirect', $registration_redirect, $errors );
    10471050
    10481051        login_header( __( 'Registration Form' ), '<p class="message register">' . __( 'Register For This Site' ) . '</p>', $errors );
Note: See TracChangeset for help on using the changeset viewer.