Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/12/2013 10:30:52 PM (13 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-friends/bp-friends-loader.php

    r7277 r7347  
    3131         */
    3232        public function includes( $includes = array() ) {
    33                 // Files to include
    3433                $includes = array(
    3534                        'actions',
    … …  
    5352         *
    5453         * @since BuddyPress (1.5)
    55          * @global BuddyPress $bp The one true BuddyPress instance
    5654         */
    5755        public function setup_globals( $args = array() ) {
    58                 global $bp;
     56                $bp = buddypress();
    5957
    6058                define ( 'BP_FRIENDS_DB_VERSION', '1800' );
    … …  
    7270                // All globals for the friends component.
    7371                // Note that global_tables is included in this array.
    74                 $globals = array(
     72                $args = array(
    7573                        'slug'                  => BP_FRIENDS_SLUG,
    7674                        'has_directory'         => false,
    … …  
    8078                );
    8179
    82                 parent::setup_globals( $globals );
     80                parent::setup_globals( $args );
    8381        }
    8482
    8583        /**
    8684         * Setup BuddyBar navigation
    87          *
    88          * @global BuddyPress $bp The one true BuddyPress instance
    8985         */
    9086        public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
    91                 global $bp;
    92 
    93                 $sub_nav = array();
     87                $bp = buddypress();
    9488
    9589                // Add 'Friends' to the main navigation
    … …  
    140134        /**
    141135         * Set up the Toolbar
    142          *
    143          * @global BuddyPress $bp The one true BuddyPress instance
    144136         */
    145137        public function setup_admin_bar( $wp_admin_nav = array() ) {
    146                 global $bp;
    147 
    148                 // Prevent debug notices
    149                 $wp_admin_nav = array();
     138                $bp = buddypress();
    150139
    151140                // Menus for logged in user
    … …  
    196185        /**
    197186         * Sets up the title for pages and <title>
    198          *
    199          * @global BuddyPress $bp The one true BuddyPress instance
    200187         */
    201188        function setup_title() {
    202                 global $bp;
     189                $bp = buddypress();
    203190
    204191                // Adjust title
    … …  
    221208
    222209function bp_setup_friends() {
    223         global $bp;
    224         $bp->friends = new BP_Friends_Component();
     210        buddypress()->friends = new BP_Friends_Component();
    225211}
    226212add_action( 'bp_setup_components', 'bp_setup_friends', 6 );
Note: See TracChangeset for help on using the changeset viewer.