diff --git bp-core/bp-core-loader.php bp-core/bp-core-loader.php
index 7dd0f51..1748ff0 100644
|
|
|
class BP_Core extends BP_Component { |
| 261 | 261 | function bp_setup_core() { |
| 262 | 262 | buddypress()->core = new BP_Core(); |
| 263 | 263 | } |
| 264 | | add_action( 'bp_setup_components', 'bp_setup_core', 2 ); |
| | 264 | add_action( 'bp_loaded', 'bp_setup_core', 0 ); |
diff --git bp-members/bp-members-loader.php bp-members/bp-members-loader.php
index d88380b..b4de372 100644
|
|
|
class BP_Members_Component extends BP_Component { |
| 80 | 80 | |
| 81 | 81 | /** Logged in user ****************************************************/ |
| 82 | 82 | |
| | 83 | // The core userdata of the user who is currently logged in. |
| | 84 | $bp->loggedin_user->userdata = bp_core_get_core_userdata( bp_loggedin_user_id() ); |
| | 85 | |
| 83 | 86 | // Fetch the full name for the logged in user |
| 84 | | $bp->loggedin_user->fullname = bp_core_get_user_displayname( bp_loggedin_user_id() ); |
| | 87 | $bp->loggedin_user->fullname = $bp->loggedin_user->userdata->display_name; |
| 85 | 88 | |
| 86 | 89 | // Hits the DB on single WP installs so get this separately |
| 87 | 90 | $bp->loggedin_user->is_super_admin = $bp->loggedin_user->is_site_admin = is_super_admin( bp_loggedin_user_id() ); |
| … |
… |
class BP_Members_Component extends BP_Component { |
| 89 | 92 | // The domain for the user currently logged in. eg: http://domain.com/members/andy |
| 90 | 93 | $bp->loggedin_user->domain = bp_core_get_user_domain( bp_loggedin_user_id() ); |
| 91 | 94 | |
| 92 | | // The core userdata of the user who is currently logged in. |
| 93 | | $bp->loggedin_user->userdata = bp_core_get_core_userdata( bp_loggedin_user_id() ); |
| 94 | | |
| 95 | 95 | /** Displayed user ****************************************************/ |
| 96 | 96 | |
| 97 | | // The domain for the user currently being displayed |
| 98 | | $bp->displayed_user->domain = bp_core_get_user_domain( bp_displayed_user_id() ); |
| 99 | | |
| 100 | 97 | // The core userdata of the user who is currently being displayed |
| 101 | 98 | $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() ); |
| 102 | 99 | |
| 103 | 100 | // Fetch the full name displayed user |
| 104 | | $bp->displayed_user->fullname = bp_core_get_user_displayname( bp_displayed_user_id() ); |
| | 101 | $bp->displayed_user->fullname = $bp->displayed_user->userdata->fullname; |
| | 102 | |
| | 103 | // The domain for the user currently being displayed |
| | 104 | $bp->displayed_user->domain = bp_core_get_user_domain( bp_displayed_user_id() ); |
| 105 | 105 | |
| 106 | 106 | /** Signup ***************************************************/ |
| 107 | 107 | $bp->signup = new stdClass; |
| … |
… |
class BP_Members_Component extends BP_Component { |
| 117 | 117 | /** Default Profile Component *****************************************/ |
| 118 | 118 | |
| 119 | 119 | if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) { |
| 120 | | if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) { |
| 121 | | $bp->default_component = bp_get_activity_slug(); |
| | 120 | if ( bp_is_active( 'activity' ) ) { |
| | 121 | $bp->default_component = $bp->activity->id; |
| 122 | 122 | } else { |
| 123 | | $bp->default_component = ( 'xprofile' === $bp->profile->id ) ? 'profile' : $bp->profile->id; |
| | 123 | $bp->default_component = ( 'xprofile' == $bp->profile->id ) ? 'profile' : $bp->profile->id; |
| 124 | 124 | } |
| 125 | | |
| 126 | 125 | } else { |
| 127 | 126 | $bp->default_component = BP_DEFAULT_COMPONENT; |
| 128 | 127 | } |
diff --git bp-xprofile/bp-xprofile-functions.php bp-xprofile/bp-xprofile-functions.php
index cd116fd..41aaed3 100644
|
|
|
function xprofile_update_field_position( $field_id, $position, $field_group_id ) |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /** |
| | 421 | * Replace the displayed and logged-in userss fullnames with the xprofile name, if required. |
| | 422 | * |
| | 423 | * The Members component uses the logged-in user's display_name to set the |
| | 424 | * value of buddypress()->loggedin_user->fullname. However, in cases where |
| | 425 | * profile sync is disabled, display_name may diverge from the xprofile |
| | 426 | * fullname field value, and the xprofile field should take precedence. |
| | 427 | * |
| | 428 | * Runs at bp_setup_globals:100 to ensure that all components have loaded their |
| | 429 | * globals before attempting any overrides. |
| | 430 | * |
| | 431 | * @since BuddyPress (2.0.0) |
| | 432 | */ |
| | 433 | function xprofile_override_user_fullnames() { |
| | 434 | // If sync is enabled, the two names will match. No need to continue. |
| | 435 | if ( ! bp_disable_profile_sync() ) { |
| | 436 | return; |
| | 437 | } |
| | 438 | |
| | 439 | if ( bp_loggedin_user_id() ) { |
| | 440 | buddypress()->loggedin_user->fullname = bp_core_get_user_displayname( bp_loggedin_user_id() ); |
| | 441 | } |
| | 442 | |
| | 443 | if ( bp_displayed_user_id() ) { |
| | 444 | buddypress()->displayed_user->fullname = bp_core_get_user_displayname( bp_displayed_user_id() ); |
| | 445 | } |
| | 446 | } |
| | 447 | add_action( 'bp_setup_globals', 'xprofile_override_user_fullnames', 100 ); |
| | 448 | |
| | 449 | /** |
| 421 | 450 | * Setup the avatar upload directory for a user. |
| 422 | 451 | * |
| 423 | 452 | * @package BuddyPress Core |