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-messages/bp-messages-loader.php

    r7277 r7347  
    4040         */
    4141        public function includes( $includes = array() ) {
     42
    4243                // Files to include
    4344                $includes = array(
     
    6364         *
    6465         * @since BuddyPress (1.5)
    65          * @global BuddyPress $bp The one true BuddyPress instance
    6666         */
    6767        public function setup_globals( $args = array() ) {
    68                 global $bp;
     68                $bp = buddypress();
    6969
    7070                // Define a slug, if necessary
     
    9696        /**
    9797         * Setup BuddyBar navigation
    98          *
    99          * @global BuddyPress $bp The one true BuddyPress instance
    10098         */
    10199        public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
    102100
    103                 $sub_nav = array();
    104                 $name    = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() );
     101                $name = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() );
    105102
    106103                // Add 'Messages' to the main navigation
     
    175172        /**
    176173         * Set up the Toolbar
    177          *
    178          * @global BuddyPress $bp The one true BuddyPress instance
    179174         */
    180175        public function setup_admin_bar( $wp_admin_nav = array() ) {
    181                 global $bp;
    182 
    183                 // Prevent debug notices
    184                 $wp_admin_nav = array();
     176                $bp = buddypress();
    185177
    186178                // Menus for logged in user
     
    249241        /**
    250242         * Sets up the title for pages and <title>
    251          *
    252          * @global BuddyPress $bp The one true BuddyPress instance
    253243         */
    254244        function setup_title() {
    255                 global $bp;
     245                $bp = buddypress();
    256246
    257247                if ( bp_is_messages_component() ) {
     
    273263
    274264function bp_setup_messages() {
    275         global $bp;
    276         $bp->messages = new BP_Messages_Component();
     265        buddypress()->messages = new BP_Messages_Component();
    277266}
    278267add_action( 'bp_setup_components', 'bp_setup_messages', 6 );
Note: See TracChangeset for help on using the changeset viewer.