Making WordPress.org


Ignore:
Timestamp:
09/23/2019 03:52:23 AM (6 years ago)
Author:
dd32
Message:

Login: Store user registrations in a custom table until they confirm their email address (at which time, we create the actual wp_users records).

This is to combat the significant number of unconfirmed accounts that are created, by separating them it's easier to purge them periodically, but also easier to add extra anti-spam checks as needed.

See #4739.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/register-profilefields.php

    r6493 r9146  
    88 */
    99
    10 $user = get_user_by( 'id', get_current_user_id() );
     10if ( empty( $fields ) ) {
     11    $user = get_user_by( 'id', get_current_user_id() );
    1112
    12 $fields = [
    13     'url'       => $user->user_url ?: '',
    14     'from'      => $user->from ?: '',
    15     'occ'       => $user->occ ?: '',
    16     'interests' => $user->interests ?: '',
    17 ];
     13    $fields = [
     14        'url'       => $user->user_url ?: '',
     15        'from'      => $user->from ?: '',
     16        'occ'       => $user->occ ?: '',
     17        'interests' => $user->interests ?: '',
     18    ];
     19}
    1820
    1921?>
    2022<p class="login-website">
    2123    <label for="user_website"><?php _e( 'Website', 'wporg' ); ?></label>
    22     <input type="text" name="user_fields[url]" id="user_url" class="input" value="<?php echo esc_attr( $fields['url'] ); ?>" size="20" placeholder="https://" />
     24    <input type="text" name="user_fields[url]" id="user_url" class="input" value="<?php echo esc_attr( $fields['url'] ?? '' ); ?>" size="20" placeholder="https://" />
    2325</p>
    2426
    2527<p class="login-location">
    2628    <label for="user_location"><?php _e( 'Location', 'wporg' ); ?></label>
    27     <input type="text" name="user_fields[from]" id="user_location" class="input" value="<?php echo esc_attr( $fields['from'] ); ?>" size="20" />
     29    <input type="text" name="user_fields[from]" id="user_location" class="input" value="<?php echo esc_attr( $fields['from'] ?? '' ); ?>" size="20" />
    2830</p>
    2931
    3032<p class="login-occupation">
    3133    <label for="user_occupation"><?php _e( 'Occupation', 'wporg' ); ?></label>
    32     <input type="text" name="user_fields[occ]" id="user_occupation" class="input" value="<?php echo esc_attr( $fields['occ'] ); ?>" size="20" />
     34    <input type="text" name="user_fields[occ]" id="user_occupation" class="input" value="<?php echo esc_attr( $fields['occ'] ?? '' ); ?>" size="20" />
    3335</p>
    3436
    3537<p class="login-interests">
    3638    <label for="user_interests"><?php _e( 'Interests', 'wporg' ); ?></label>
    37     <input type="text" name="user_fields[interests]" id="user_interests" class="input" value="<?php echo esc_attr( $fields['interests'] ); ?>" size="20" />
     39    <input type="text" name="user_fields[interests]" id="user_interests" class="input" value="<?php echo esc_attr( $fields['interests'] ?? '' ); ?>" size="20" />
    3840</p>
    3941
Note: See TracChangeset for help on using the changeset viewer.