Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/14/2012 06:33:23 PM (12 years ago)
Author:
boonebgorges
Message:

Improvements to the way the hide_sitewide default is determined in groups_record_activity()

groups_record_activity() should attempt to use the item_id passed to the
function when determining the default value of 'hide_sitewide', instead of the
current group id (which will not always be populated, eg in the groups
directory).

Fixes #4134

Props chriskeeble

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-activity.php

    r6093 r6097  
    3535        return false;
    3636
    37     // If the group is not public, hide the activity sitewide.
    38     if ( isset( $bp->groups->current_group->status ) && 'public' == $bp->groups->current_group->status )
    39         $hide_sitewide = false;
    40     else
    41         $hide_sitewide = true;
     37    // Set the default for hide_sitewide by checking the status of the group
     38    $hide_sitewide = false;
     39    if ( !empty( $args['item_id'] ) ) {
     40        if ( bp_get_current_group_id() == $args['item_id'] ) {
     41            $group = groups_get_current_group();
     42        } else {
     43            $group = groups_get_group( array( 'group_id' => $args['item_id'] ) );
     44        }
     45
     46        if ( isset( $group->status ) && 'public' != $group->status ) {
     47            $hide_sitewide = true;
     48        }
     49    }
    4250
    4351    $defaults = array (
Note: See TracChangeset for help on using the changeset viewer.