[buddypress-trac] [BuddyPress Trac] #7661: Use WP functions to retrieve user name, display name, nicename, and email.

buddypress-trac noreply at wordpress.org
Thu Jan 18 19:31:50 UTC 2018

#7661: Use WP functions to retrieve user name, display name, nicename, and email.
 Reporter:  dcavins      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Members      |    Version:  2.9.2
 Severity:  normal       |   Keywords:  has-patch
 BuddyPress is doing quite a bit of work to fetch and cache some basic user
 info that I think we can rely on WP to fetch and cache. After looking at
 `bp-members-functions.php` for a related discussion about using WP
 functions to fetch the current user ID (see #7658), it appears to me that
 some of our original functions to fetch basic user data like user name,
 display name, nicename, and email could be replaced with core WordPress
 functions that have come along or been improved in the ten years since BP
 was first built. This would save on redundancy of code and also remove
 some one-off caches that were built to avoid multiple lookups.

 Please see the attached patch for the first round of changes I'd propose.

 Note that a few tests with display names are failing, but I'm not sure if
 the issue is with the tests or the change in code. (The tests set the
 xprofile data for display name, but the WP sync isn't happening because of
 the way it's being done.) I'm unfamiliar with the profile data sync setup,
 so it could be that I've caused a problem by changing

 Thanks for your comments.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7661>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list