Changeset 8610 for trunk/src/bp-xprofile/bp-xprofile-functions.php
- Timestamp:
- 07/12/2014 03:01:27 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-xprofile/bp-xprofile-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-functions.php
r8534 r8610 498 498 499 499 /** 500 * Replace the displayed and logged-in userss fullnames with the xprofile name, if required. 501 * 502 * The Members component uses the logged-in user's display_name to set the 503 * value of buddypress()->loggedin_user->fullname. However, in cases where 504 * profile sync is disabled, display_name may diverge from the xprofile 505 * fullname field value, and the xprofile field should take precedence. 506 * 507 * Runs at bp_setup_globals:100 to ensure that all components have loaded their 508 * globals before attempting any overrides. 509 * 510 * @since BuddyPress (2.0.0) 511 */ 512 function xprofile_override_user_fullnames() { 513 // If sync is enabled, the two names will match. No need to continue. 514 if ( ! bp_disable_profile_sync() ) { 515 return; 516 } 517 518 if ( bp_loggedin_user_id() ) { 519 buddypress()->loggedin_user->fullname = bp_core_get_user_displayname( bp_loggedin_user_id() ); 520 } 521 522 if ( bp_displayed_user_id() ) { 523 buddypress()->displayed_user->fullname = bp_core_get_user_displayname( bp_displayed_user_id() ); 524 } 525 } 526 add_action( 'bp_setup_globals', 'xprofile_override_user_fullnames', 100 ); 527 528 /** 500 529 * Setup the avatar upload directory for a user. 501 530 *
Note: See TracChangeset
for help on using the changeset viewer.