Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/10/2014 09:59:19 PM (11 years ago)
Author:
imath
Message:

In bp_is_group(), make sure Groups component is active before trying to get current group.

In case the groups component has been deactivated, as the WordPress page still exists, there is a possibility the Groups page is displayed. In that case, this commit prevents an error.

Fixes #5871

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template.php

    r8969 r9002  
    19271927 */
    19281928function bp_is_group() {
    1929     return (bool) ( bp_is_groups_component() && groups_get_current_group() );
     1929    $retval = bp_is_active( 'groups' );
     1930
     1931    if ( ! empty( $retval ) ) {
     1932        $retval = bp_is_groups_component() && groups_get_current_group();
     1933    }
     1934   
     1935    return (bool) $retval;
    19301936}
    19311937
Note: See TracChangeset for help on using the changeset viewer.