Skip to:
Content

bbPress.org


Ignore:
Timestamp:
03/07/2017 07:05:18 PM (8 years ago)
Author:
johnjamesjacoby
Message:

BuddyPress: Filter bbp_is_single_forum for group forums.

Props r-a-y. Fixes #2727. See #2974.

File:
1 edited

Legend:

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

    r6272 r6367  
    110110
    111111        // Ensure bbp_is_single_topic() returns true on group forum topics.
     112        add_filter( 'bbp_is_single_forum',       array( $this, 'is_single_forum' ) );
     113
     114        // Ensure bbp_is_single_topic() returns true on group forum topics.
    112115        add_filter( 'bbp_is_single_topic',       array( $this, 'is_single_topic' ) );
    113116
     
    148151            add_filter( 'bbp_current_user_can_access_create_reply_form', array( $this, 'form_permissions' ) );
    149152        }
     153    }
     154
     155    /**
     156     * Ensure that bbp_is_single_forum() returns true on group forum pages.
     157     *
     158     * @see https://bbpress.trac.wordpress.org/ticket/2974
     159     *
     160     * @since 2.6.0 bbPress (r6366)
     161     *
     162     * @param  bool $retval Current boolean.
     163     * @return bool
     164     */
     165    public function is_single_forum( $retval = false ) {
     166
     167        // Additional BuddyPress specific single-forum conditionals
     168        if ( false === $retval ) {
     169            if ( bp_is_group() && bp_is_action_variable( $this->forum_slug, 0 ) ) {
     170                $retval = true;
     171            }
     172        }
     173
     174        return $retval;
    150175    }
    151176
Note: See TracChangeset for help on using the changeset viewer.