Changeset 7347 for trunk/bp-members/bp-members-loader.php
- Timestamp:
- 08/12/2013 10:30:52 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/bp-members/bp-members-loader.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-loader.php
r7277 r7347 53 53 * 54 54 * @since BuddyPress (1.5) 55 * @global BuddyPress $bp The one true BuddyPress instance56 55 */ 57 56 public function setup_globals( $args = array() ) { 58 global $bp;57 $bp = buddypress(); 59 58 60 59 // Define a slug, if necessary … … 62 61 define( 'BP_MEMBERS_SLUG', $this->id ); 63 62 64 $globals =array(63 parent::setup_globals( array( 65 64 'slug' => BP_MEMBERS_SLUG, 66 65 'root_slug' => isset( $bp->pages->members->slug ) ? $bp->pages->members->slug : BP_MEMBERS_SLUG, 67 66 'has_directory' => true, 68 67 'search_string' => __( 'Search Members...', 'buddypress' ), 69 ); 70 71 parent::setup_globals( $globals ); 68 ) ); 72 69 73 70 /** Logged in user ****************************************************/ … … 105 102 106 103 /** Default Profile Component *****************************************/ 104 107 105 if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) { 108 if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) 106 if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) { 109 107 $bp->default_component = bp_get_activity_slug(); 110 else 111 $bp->default_component = ( 'xprofile' == $bp->profile->id ) ? 'profile' : $bp->profile->id; 108 } else { 109 $bp->default_component = ( 'xprofile' === $bp->profile->id ) ? 'profile' : $bp->profile->id; 110 } 112 111 113 112 } else { … … 141 140 /** 142 141 * Setup BuddyBar navigation 143 *144 * @global BuddyPress $bp The one true BuddyPress instance145 142 */ 146 143 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 147 global $bp;144 $bp = buddypress(); 148 145 149 146 // Add 'Profile' to the main navigation … … 151 148 152 149 // Don't set up navigation if there's no user 153 if ( !is_user_logged_in() && !bp_is_user() ) 150 if ( !is_user_logged_in() && !bp_is_user() ) { 154 151 return; 155 156 $sub_nav = array(); 152 } 153 157 154 $main_nav = array( 158 155 'name' => __( 'Profile', 'buddypress' ), … … 165 162 166 163 // User links 167 $user_domain = bp_displayed_user_domain() ? bp_displayed_user_domain() : bp_loggedin_user_domain();168 $profile_link = trailingslashit( $user_domain . $bp->profile->slug );164 $user_domain = bp_displayed_user_domain() ? bp_displayed_user_domain() : bp_loggedin_user_domain(); 165 $profile_link = trailingslashit( $user_domain . $bp->profile->slug ); 169 166 170 167 // Add the subnav items to the profile … … 188 185 */ 189 186 function setup_title() { 190 global $bp;187 $bp = buddypress(); 191 188 192 189 if ( bp_is_my_profile() ) { … … 206 203 207 204 function bp_setup_members() { 208 global $bp; 209 $bp->members = new BP_Members_Component(); 205 buddypress()->members = new BP_Members_Component(); 210 206 } 211 207 add_action( 'bp_setup_components', 'bp_setup_members', 1 );
Note: See TracChangeset
for help on using the changeset viewer.