Skip to:
Content

bbPress.org

Changeset 6372


Ignore:
Timestamp:
03/07/2017 11:37:19 PM (8 years ago)
Author:
johnjamesjacoby
Message:

BuddyPress: Dynamic activity for topics & replies, part 2.

  • Filters for activity action functions
  • Tests for the new activity filters

Props thebrandonallen. See #2794.

Location:
trunk
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/buddypress/activity.php

    r6250 r6372  
    196196    public function register_activity_actions() {
    197197
    198         // Sitewide activity stream items
    199         bp_activity_set_action( $this->component, $this->topic_create, esc_html__( 'New forum topic', 'bbpress' ) );
    200         bp_activity_set_action( $this->component, $this->reply_create, esc_html__( 'New forum reply', 'bbpress' ) );
     198        // Sitewide topic
     199        bp_activity_set_action(
     200            bbp_get_component_name(),
     201            $this->topic_create,
     202            esc_html__( 'New forum topic', 'bbpress' ),
     203            'bbp_bp_format_activity_action_new_topic',
     204            esc_html__( 'Topics', 'bbpress' ),
     205            array( 'activity', 'member', 'member_groups', 'group' )
     206        );
     207
     208        // Sitewide reply
     209        bp_activity_set_action(
     210            bbp_get_component_name(),
     211            $this->reply_create,
     212            esc_html__( 'New forum reply', 'bbpress' ),
     213            'bbp_bp_format_activity_action_new_reply',
     214            esc_html__( 'Replies', 'bbpress' ),
     215            array( 'activity', 'member', 'member_groups', 'group' )
     216        );
     217
     218        // Group forums
     219        /**
     220         * An upstream improvement to BuddyPress is required to make these work,
     221         * but they are included here to make our lives easier later.
     222        if ( bp_is_active( 'groups' ) ) {
     223
     224            // Topic
     225            bp_activity_set_action(
     226                buddypress()->groups->id,
     227                $this->topic_create,
     228                esc_html__( 'New forum topic', 'bbpress' ),
     229                'bbp_bp_format_activity_action_new_topic',
     230                esc_html__( 'Topics', 'bbpress' ),
     231                array( 'activity', 'member', 'member_groups', 'group' )
     232            );
     233
     234            // Reply
     235            bp_activity_set_action(
     236                buddypress()->groups->id,
     237                $this->reply_create,
     238                esc_html__( 'New forum reply', 'bbpress' ),
     239                'bbp_bp_format_activity_action_new_reply',
     240                esc_html__( 'Replies', 'bbpress' ),
     241                array( 'activity', 'member', 'member_groups', 'group' )
     242            );
     243        }
     244        */
    201245    }
    202246
Note: See TracChangeset for help on using the changeset viewer.