[buddypress-trac] [BuddyPress Trac] #5445: Improve consistency of bp_core_get_user_* use

buddypress-trac noreply at wordpress.org
Mon Mar 3 21:35:49 UTC 2014

#5445: Improve consistency of bp_core_get_user_* use
 Reporter:  boonebgorges  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  2.0
Component:  Core          |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |

Comment (by boonebgorges):

 In [changeset:"8027"]:
 #!CommitTicketReference repository="" revision="8027"
 Introduce bp_core_user_displaynames(), for quick, bulk displayname lookup

 The technique BP uses for determining a user's displayname takes into
 consideration whether the xprofile component is active, whether the user
 has a
 WP display_name, and a number of other factors. Because the values are
 used so
 often throughout BP, they are then cached in WP's object cache. However,
 are a number of places throughout BuddyPress where displaynames are
 in a way that is inconsistent with the "canonical" workflow (ie, by
 the xprofile tables correctly). This causes inconsistent results, and also
 result in performance degradation when the persistent cache is skipped.
 Moreover, the singular nature of bp_core_get_user_displayname() meant that
 doing it the "right" way meant introducing large numbers of queries to a
 page load.

 This changeset introduces bp_core_get_user_displaynames(), which contains
 the critical logic of bp_core_get_user_displayname() - including fallbacks
 various setups and support for the object cache - but allows for fetching
 numbers of displaynames without multiple queries.
 is now a wrapper for the more general function.

 The function has been swapped in throughout BuddyPress as appropriate.

 See #5445

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5445#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list