Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/12/2013 10:30:52 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Audit loader classes, and remove $bp global touches in lieu of using the buddypress() function. Also some whitespace clean-up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-loader.php

    r7277 r7347  
    3535     *
    3636     * @since BuddyPress (1.5)
    37      * @global BuddyPress $bp The one true BuddyPress instance
    3837     */
    3938    public function setup_globals( $args = array() ) {
    40         global $bp;
     39        $bp = buddypress();
    4140
    4241        if ( !defined( 'BP_BLOGS_SLUG' ) )
     
    5150        // All globals for messaging component.
    5251        // Note that global_tables is included in this array.
    53         $globals = array(
     52        $args = array(
    5453            'slug'                  => BP_BLOGS_SLUG,
    5554            'root_slug'             => isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG,
     
    6261
    6362        // Setup the globals
    64         parent::setup_globals( $globals );
     63        parent::setup_globals( $args );
    6564    }
    6665
     
    9190    /**
    9291     * Setup BuddyBar navigation
    93      *
    94      * @global BuddyPress $bp The one true BuddyPress instance
    9592     */
    9693    public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
    97         global $bp;
     94        $bp = buddypress();
    9895
    9996        /**
     
    104101        if ( !is_multisite() )
    105102            return false;
    106 
    107         $sub_nav = array();
    108103
    109104        // Add 'Sites' to the main navigation
     
    147142     */
    148143    public function setup_admin_bar( $wp_admin_nav = array() ) {
    149         global $bp;
     144        $bp = buddypress();
    150145
    151146        /**
     
    156151        if ( !is_multisite() )
    157152            return false;
    158 
    159         // Prevent debug notices
    160         $wp_admin_nav = array();
    161153
    162154        // Menus for logged in user
     
    197189    /**
    198190     * Sets up the title for pages and <title>
    199      *
    200      * @global BuddyPress $bp The one true BuddyPress instance
    201191     */
    202192    function setup_title() {
    203         global $bp;
     193        $bp = buddypress();
    204194
    205195        // Set up the component options navigation for Blog
     
    227217
    228218function bp_setup_blogs() {
    229     global $bp;
    230     $bp->blogs = new BP_Blogs_Component();
     219    buddypress()->blogs = new BP_Blogs_Component();
    231220}
    232221add_action( 'bp_setup_components', 'bp_setup_blogs', 6 );
Note: See TracChangeset for help on using the changeset viewer.