Skip to:
Content

bbPress.org

Changeset 4720


Ignore:
Timestamp:
01/27/2013 12:27:51 AM (8 years ago)
Author:
johnjamesjacoby
Message:

In BuddyPress's loader, setup components in priority 7, to get them in before activity actions are registered. Props r-a-y. Fixes #2176.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/extend/buddypress/loader.php

    r4661 r4720  
    104104
    105105    /**
    106      * Instantiate classes for BuddyPress integration
    107      *
    108      * @since bbPress (r3395)
    109      */
    110     public function setup_components() {
    111 
    112         // Always load the members component
    113         bbpress()->extend->buddypress->members = new BBP_BuddyPress_Members;
    114 
    115         // Create new activity class
    116         if ( bp_is_active( 'activity' ) ) {
    117             bbpress()->extend->buddypress->activity = new BBP_BuddyPress_Activity;
    118         }
    119 
    120         // Register the group extension only if groups are active
    121         if ( bbp_is_group_forums_active() && bp_is_active( 'groups' ) ) {
    122             bp_register_group_extension( 'BBP_Forums_Group_Extension' );
    123         }
    124     }
    125 
    126     /**
    127106     * Setup the actions
    128107     *
     
    131110     * @uses add_filter() To add various filters
    132111     * @uses add_action() To add various actions
     112     * @link http://bbpress.trac.wordpress.org/ticket/2176
    133113     */
    134114    public function setup_actions() {
    135115
    136116        // Setup the components
    137         add_action( 'bp_init', array( $this, 'setup_components' ) );
     117        add_action( 'bp_init', array( $this, 'setup_components' ), 7 );
    138118
    139119        parent::setup_actions();
     120    }
     121
     122    /**
     123     * Instantiate classes for BuddyPress integration
     124     *
     125     * @since bbPress (r3395)
     126     */
     127    public function setup_components() {
     128
     129        // Always load the members component
     130        bbpress()->extend->buddypress->members = new BBP_BuddyPress_Members;
     131
     132        // Create new activity class
     133        if ( bp_is_active( 'activity' ) ) {
     134            bbpress()->extend->buddypress->activity = new BBP_BuddyPress_Activity;
     135        }
     136
     137        // Register the group extension only if groups are active
     138        if ( bbp_is_group_forums_active() && bp_is_active( 'groups' ) ) {
     139            bp_register_group_extension( 'BBP_Forums_Group_Extension' );
     140        }
    140141    }
    141142
Note: See TracChangeset for help on using the changeset viewer.