Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/25/2018 07:44:54 PM (8 years ago)
Author:
dcavins
Message:

Use WP functions to retrieve user data.

Use WP functions to retrieve user name, display name, nicename, and email.

Switch functions like bp_core_get_username() to use native WordPress functions. This also removes the need for maintaining redundant cached items, like caching individual usernames, and instead relies upon WP's userdata cache.

Props dcavins, djpaul.

Fixes #7661.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-core-user.php

    r11705 r11818  
    166166            $this->email     = esc_attr( bp_core_get_user_email( $this->id ) );
    167167        }
    168 
    169         // Cache a few things that are fetched often.
    170         wp_cache_set( 'bp_user_fullname_' . $this->id, $this->fullname, 'bp' );
    171         wp_cache_set( 'bp_user_email_' . $this->id, $this->email, 'bp' );
    172         wp_cache_set( 'bp_user_url_' . $this->id, $this->user_url, 'bp' );
    173168
    174169        $this->avatar       = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ) ) );
Note: See TracChangeset for help on using the changeset viewer.