WordPress.org

Making WordPress.org

Changeset 4953


Ignore:
Timestamp:
02/19/2017 10:34:05 PM (4 years ago)
Author:
ocean90
Message:

Login: Use a fresh user object for the user fields template.

The page doesn't get reloaded when updating a field, which means the initial user object still has the old values.

See #148.

File:
1 edited

Legend:

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

    r4534 r4953  
    88 */
    99
    10 $fields = array(
    11     'url'       => wp_get_current_user()->user_url ?: '',
    12     'from'      => get_user_meta( get_current_user_id(), 'from', true ) ?: '',
    13     'occ'       => get_user_meta( get_current_user_id(), 'occ', true ) ?: '',
    14     'interests' => get_user_meta( get_current_user_id(), 'interests', true ) ?: '',
    15 );
     10$user = get_user_by( 'id', get_current_user_id() );
     11
     12$fields = [
     13    'url'       => $user->user_url ?: '',
     14    'from'      => $user->from ?: '',
     15    'occ'       => $user->occ ?: '',
     16    'interests' => $user->interests ?: '',
     17];
    1618
    1719?>
Note: See TracChangeset for help on using the changeset viewer.