Changeset 7347 for trunk/bp-groups/bp-groups-loader.php
- Timestamp:
- 08/12/2013 10:30:52 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/bp-groups/bp-groups-loader.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-loader.php
r7277 r7347 119 119 * 120 120 * @since BuddyPress (1.5) 121 * @global BuddyPress $bp The one true BuddyPress instance122 121 */ 123 122 public function setup_globals( $args = array() ) { 124 global $bp;123 $bp = buddypress(); 125 124 126 125 // Define a slug, if necessary … … 137 136 // All globals for groups component. 138 137 // Note that global_tables is included in this array. 139 $ globals = array(138 $args = array( 140 139 'slug' => BP_GROUPS_SLUG, 141 140 'root_slug' => isset( $bp->pages->groups->slug ) ? $bp->pages->groups->slug : BP_GROUPS_SLUG, … … 146 145 ); 147 146 148 parent::setup_globals( $ globals );147 parent::setup_globals( $args ); 149 148 150 149 /** Single Group Globals **********************************************/ … … 339 338 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 340 339 341 // Define local variables342 $sub_nav = array();343 344 340 // Add 'Groups' to the main navigation 345 341 $main_nav = array( … … 489 485 } 490 486 491 if ( isset( $this->current_group->user_has_access ) ) 487 if ( isset( $this->current_group->user_has_access ) ) { 492 488 do_action( 'groups_setup_nav', $this->current_group->user_has_access ); 493 else489 } else { 494 490 do_action( 'groups_setup_nav'); 491 } 495 492 } 496 493 497 494 /** 498 495 * Set up the Toolbar 499 *500 * @global BuddyPress $bp The one true BuddyPress instance501 496 */ 502 497 public function setup_admin_bar( $wp_admin_nav = array() ) { 503 global $bp; 504 505 // Prevent debug notices 506 $wp_admin_nav = array(); 498 $bp = buddypress(); 507 499 508 500 // Menus for logged in user … … 563 555 /** 564 556 * Sets up the title for pages and <title> 565 *566 * @global BuddyPress $bp The one true BuddyPress instance567 557 */ 568 558 function setup_title() { 569 global $bp;559 $bp = buddypress(); 570 560 571 561 if ( bp_is_groups_component() ) { 572 562 573 563 if ( bp_is_my_profile() && !bp_is_single_item() ) { 574 575 564 $bp->bp_options_title = __( 'Memberships', 'buddypress' ); 576 565 577 566 } else if ( !bp_is_my_profile() && !bp_is_single_item() ) { 578 579 567 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 580 568 'item_id' => bp_displayed_user_id(), … … 595 583 'alt' => __( 'Group Avatar', 'buddypress' ) 596 584 ) ); 585 597 586 if ( empty( $bp->bp_options_avatar ) ) { 598 $bp->bp_options_avatar = '<img src="' . esc_attr( $group->avatar_full ) . '" class="avatar" alt="' . esc_attr( $group->name ) . '" />';587 $bp->bp_options_avatar = bp_group_current_avatar(); 599 588 } 600 589 } … … 607 596 608 597 function bp_setup_groups() { 609 global $bp; 610 611 $bp->groups = new BP_Groups_Component(); 598 buddypress()->groups = new BP_Groups_Component(); 612 599 } 613 600 add_action( 'bp_setup_components', 'bp_setup_groups', 6 );
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)