Making WordPress.org


Ignore:
Timestamp:
02/02/2022 08:40:57 AM (4 years ago)
Author:
dd32
Message:

Login: Run the wp_insert_user() filters during the registration process.

This prevent filters/errors that occur during the pending->user account process not being surfaced during registration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php

    r11485 r11505  
    337337            $value = trim( sanitize_text_field( wp_unslash( $_POST['user_fields'][ $field ] ) ) );
    338338            if ( 'url' == $field ) {
     339                /** This filter is documented in wp-includes/user.php */
     340                $value = apply_filters( 'pre_user_url', $value );
     341
    339342                if ( $pending_user ) {
    340343                    $pending_user['meta'][ $field ] = esc_url_raw( $value );
     
    367370        $new_email !== $pending_user['user_email']
    368371    ) {
     372        /** This filter is documented in wp-includes/user.php */
     373        $new_email = apply_filters( 'pre_user_email', $new_email );
     374
    369375        // Validate the email
    370376        $error_user_email = rest_do_request( new WP_REST_Request( 'GET', '/wporg/v1/email-in-use/' . urlencode( $new_email ) ) );
Note: See TracChangeset for help on using the changeset viewer.