Changeset 9936 for trunk/src/bp-core/bp-core-loader.php
- Timestamp:
- 06/11/2015 06:53:59 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-loader.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-loader.php
r9819 r9936 151 151 public function includes( $includes = array() ) { 152 152 153 if ( ! is_admin() )153 if ( ! is_admin() ) { 154 154 return; 155 } 155 156 156 157 $includes = array( … … 179 180 180 181 // Get the base database prefix 181 if ( empty( $bp->table_prefix ) ) 182 if ( empty( $bp->table_prefix ) ) { 182 183 $bp->table_prefix = bp_core_get_table_prefix(); 184 } 183 185 184 186 // The domain for the root of the site where the main blog resides 185 if ( empty( $bp->root_domain ) ) 187 if ( empty( $bp->root_domain ) ) { 186 188 $bp->root_domain = bp_core_get_root_domain(); 189 } 187 190 188 191 // Fetches all of the core BuddyPress settings in one fell swoop 189 if ( empty( $bp->site_options ) ) 192 if ( empty( $bp->site_options ) ) { 190 193 $bp->site_options = bp_core_get_root_options(); 194 } 191 195 192 196 // The names of the core WordPress pages used to display BuddyPress content 193 if ( empty( $bp->pages ) ) 197 if ( empty( $bp->pages ) ) { 194 198 $bp->pages = bp_core_get_directory_pages(); 199 } 195 200 196 201 /** Basic current user data *******************************************/ … … 261 266 262 267 /** 263 * Set up component navigation.264 *265 * @since BuddyPress (1.5.0)266 *267 * @see BP_Component::setup_nav() for a description of arguments.268 *269 * @param array $main_nav Optional. See BP_Component::setup_nav() for270 * description.271 * @param array $sub_nav Optional. See BP_Component::setup_nav() for272 * description.273 */274 public function setup_nav( $main_nav = array(), $sub_nav = array() ) {275 $bp = buddypress();276 277 // If xprofile component is disabled, revert to WordPress profile278 if ( !bp_is_active( 'xprofile' ) ) {279 280 // Fallback values if xprofile is disabled281 if ( ! isset( $bp->core->profile ) ) {282 $bp->core->profile = new stdClass;283 }284 $bp->core->profile->slug = 'profile';285 $bp->active_components[$bp->core->profile->slug] = $bp->core->profile->slug;286 287 // Add 'Profile' to the main navigation288 $main_nav = array(289 'name' => _x( 'Profile', 'Main navigation', 'buddypress' ),290 'slug' => $bp->core->profile->slug,291 'position' => 20,292 'screen_function' => 'bp_core_catch_profile_uri',293 'default_subnav_slug' => 'public'294 );295 296 $profile_link = trailingslashit( bp_loggedin_user_domain() . '/' . $bp->core->profile->slug );297 298 // Add the subnav items to the profile299 $sub_nav[] = array(300 'name' => _x( 'View', 'Profile sub nav', 'buddypress' ),301 'slug' => 'public',302 'parent_url' => $profile_link,303 'parent_slug' => $bp->core->profile->slug,304 'screen_function' => 'bp_core_catch_profile_uri'305 );306 307 parent::setup_nav( $main_nav, $sub_nav );308 }309 }310 311 /**312 268 * Setup cache groups 313 269 *
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)