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

    r7277 r7347  
    5353        // Load Akismet support if Akismet is configured
    5454        $akismet_key = bp_get_option( 'wordpress_api_key' );
    55         if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) )
     55        if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
    5656            $includes[] = 'akismet';
    57 
    58         if ( is_admin() )
     57        }
     58
     59        if ( is_admin() ) {
    5960            $includes[] = 'admin';
     61        }
    6062
    6163        parent::includes( $includes );
     
    6971     *
    7072     * @since BuddyPress (1.5)
    71      *
    72      * @global object $bp BuddyPress global settings
    7373     */
    7474    public function setup_globals( $args = array() ) {
    75         global $bp;
     75        $bp = buddypress();
    7676
    7777        // Define a slug, if necessary
     
    8787        // All globals for activity component.
    8888        // Note that global_tables is included in this array.
    89         $globals = array(
     89        $args = array(
    9090            'slug'                  => BP_ACTIVITY_SLUG,
    9191            'root_slug'             => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG,
     
    9696        );
    9797
    98         parent::setup_globals( $globals );
     98        parent::setup_globals( $args );
    9999    }
    100100
     
    111111     */
    112112    public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
    113 
    114         $sub_nav = array();
    115113
    116114        // Add 'Activity' to the main navigation
     
    218216     */
    219217    public function setup_admin_bar( $wp_admin_nav = array() ) {
    220         global $bp;
    221 
    222         // Prevent debug notices
    223         $wp_admin_nav = array();
     218        $bp = buddypress();
    224219
    225220        // Menus for logged in user
     
    309304     */
    310305    function setup_title() {
    311         global $bp;
     306        $bp = buddypress();
    312307
    313308        // Adjust title based on view
     
    342337
    343338function bp_setup_activity() {
    344     global $bp;
    345 
    346     $bp->activity = new BP_Activity_Component();
     339    buddypress()->activity = new BP_Activity_Component();
    347340}
    348341add_action( 'bp_setup_components', 'bp_setup_activity', 6 );
Note: See TracChangeset for help on using the changeset viewer.