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

buddypress-trac noreply at wordpress.org
Wed Jan 24 10:39:07 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:  3.0
Component:  Members      |     Version:  2.9.2
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+--------------------
Changes (by DJPaul):

 * milestone:  Under Consideration => 3.0


Comment:

 This looks great. If you are ready to commit after looking at my feedback,
 go for it.

 > Note also that I've changed the WP<->BP profile sync hook

 I like it!

 > Advanced level nit-picking ;)

 1) In `xprofile_sync_wp_profile_on_single_field_set()`, if the fields
 don't match, return early. Then outside the braces, on the next line, then
 call `xprofile_sync_wp_profile()`. Why? Indenting units of code can be
 seen as increasing their complexity. This is a measure static analysis
 tools rank on, but (for really large functions) I also think it makes it
 more readable, as we keep the intended code at the base level of
 indentation, and use the indentation to mark the "edge case".

 {{{
 if ( bp_xprofile_fullname_field_id() !== $data->field_id ) {
 return;
 }

 xprofile_sync_wp_profile( $data->user_id );
 }}}

 2. `"// Nicename and login were not passed."` I know this comment pre-
 exists but does it add value in its new location? Is it not obvious, given
 the proximity to the start of the function, that these are optional
 variables? When I read it, it does seem redundant, but if you think
 otherwise, by all means keep it.

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


More information about the buddypress-trac mailing list