Skip to:
Content

bbPress.org

Changeset 4716


Ignore:
Timestamp:
01/25/2013 05:09:47 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Map group forum meta caps directly to 'bbp_map_meta_caps' filter to avoid recursion. Also remove BuddyPress 'topic' action check, to allow single group-forum capability map to work correctly. Fixes #2140.

File:
1 edited

Legend:

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

    r4702 r4716  
    112112
    113113        // Allow group member to view private/hidden forums
    114         add_filter( 'bbp_map_topic_meta_caps',   array( $this, 'map_topic_meta_caps'          ), 10, 4 );
    115         add_filter( 'bbp_map_reply_meta_caps',   array( $this, 'map_topic_meta_caps'          ), 10, 4 );
     114        add_filter( 'bbp_map_meta_caps',         array( $this, 'map_group_forum_meta_caps'    ), 99, 4 );
    116115
    117116        // Map group forum activity items to groups
     
    178177     * @return array
    179178     */
    180     public function map_topic_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
    181 
    182         // Bail if not viewing a single topic
    183         if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'forum' ) || ! bp_is_action_variable( 0, 'topic' ) )
     179    public function map_group_forum_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
     180
     181        // Bail if not viewing a group forum
     182        if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'forum' ) )
    184183            return $caps;
    185184
Note: See TracChangeset for help on using the changeset viewer.