Making WordPress.org


Ignore:
Timestamp:
05/17/2021 04:58:00 AM (8 months ago)
Author:
dd32
Message:

Registration: Allow changing of email address during the registration flow.

This is only available once per account, and only prior to confirming the email address.

Fixes #5181.

File:
1 edited

Legend:

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

    r10928 r10981  
    4444}
    4545
    46 if ( wporg_login_save_profile_fields( $pending_user ) ) {
     46if ( wporg_login_save_profile_fields( $pending_user, 'pending' ) ) {
    4747    // re-fetch the user, it's probably changed.
    4848    $pending_user = wporg_get_pending_user( $profile_user );
    4949}
    5050wp_enqueue_script( 'wporg-registration' );
     51
     52// Allow changing the email, if they've not already changed it once.
     53$email_change_available = empty( $pending_user['meta']['changed_email'] );
    5154
    5255get_header();
     
    5962            printf(
    6063                /* translators: %s Email address */
    61                 __( 'Please check your email %s for a confirmation link to set your password.', 'wporg' ) . '<br>' .
    62                 '<a href="#" class="resend" data-account="%s">' . __( 'Resend confirmation email.', 'wporg' ) . '</a>',
     64                __( 'Please check your email %s for a confirmation link to set your password.', 'wporg' ) .
     65                '<br><br>' . '<a href="#" class="resend" data-account="%s">' . __( 'Resend confirmation email.', 'wporg' ) . '</a>' .
     66                ( $email_change_available ? '<br>' . '<a href="#" class="change-email">' . __( 'Incorrect email? Update email address.', 'wporg' ) . '</a>' : '' ),
    6367                '<code>' . esc_html( $pending_user['user_email'] ) . '</code>',
    6468                esc_attr( $pending_user['user_email'] )
     
    6771            printf(
    6872                /* translators: %s Email address */
    69                 __( 'Your account is pending approval. You will receive an email at %s to set your password when approved.', 'wporg' ) . '<br>' .
    70                 __( 'Please contact %s for more details.', 'wporg' ),
     73                __( 'Your account is pending approval. You will receive an email at %s to set your password when approved.', 'wporg' ) .
     74                '<br>' . __( 'Please contact %s for more details.', 'wporg' ) .
     75                ( $email_change_available ? '<br><br>' . '<a href="#" class="change-email">' . __( 'Incorrect email? Update email address.', 'wporg' ) . '</a>' : '' ),
    7176                '<code>' . esc_html( $pending_user['user_email'] ) . '</code>',
    7277                '<a href="mailto:' . $sso::SUPPORT_EMAIL . '">' . $sso::SUPPORT_EMAIL . '</a>'
     
    8388        <label for="user_login"><?php _e( 'Username', 'wporg' ); ?></label>
    8489        <input type="text" disabled="disabled" class=" disabled" value="<?php echo esc_attr( $profile_user ); ?>" size="20" />
     90    </p>
     91
     92    <p class="login-email hidden">
     93        <label for="user_email"><?php _e( 'Email', 'wporg' ); ?></label>
     94        <input type="text" name="user_email" value="<?php echo esc_attr( $pending_user['user_email'] ); ?>" size="20" maxlength="100" />
    8595    </p>
    8696
Note: See TracChangeset for help on using the changeset viewer.