[buddypress-trac] [BuddyPress Trac] #5764: Incorrect way of setting the displayed user "fullname" in bp-members-loader.php

buddypress-trac noreply at wordpress.org
Fri Jul 18 15:55:29 UTC 2014


#5764: Incorrect way of setting the displayed user "fullname" in bp-members-
loader.php
--------------------------+-----------------------------------
 Reporter:  imath         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  high          |  Milestone:  2.1
Component:  Members       |    Version:
 Severity:  normal        |   Keywords:  has-patch 2nd-opinion
--------------------------+-----------------------------------
 In r8610, commit message is saying :
 >In bp-members, use only WP core data to set up the loggedin_user and
 displayed_user global objects. Previously, these objects were configured
 by referenced to xprofile, which required that xprofile be loaded before
 members. Now, users' display names are first loaded from wp_users, and are
 overridden by the xprofile

 The problem is, since this commit, the {{{$bp->displayed_user->fullname}}}
 is never set causing various troubles in single member {{{<title>}}} html
 tag, in the {{{post_title}}} of the single member, in the title of the
 friends widget.. Actually, anywhere the
 {{{bp_get_displayed_user_fullname()}}} function is used.

 It's never set because the "fullname" attribute is not a wp_users field
 and {{{bp_core_get_core_userdata()}}} is only getting wp_users fields.
 Using WP Core
 [http://codex.wordpress.org/Function_Reference/get_userdata#Accessing_Usermeta_Data
 get_userdata()] wouldn't get the "fullname" neither as it's not one of the
 user_meta returned by WordPress.

 I suggest to use the display_name attribute instead to avoid these
 troubles.

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


More information about the buddypress-trac mailing list