Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/19/2010 12:29:04 PM (14 years ago)
Author:
djpaul
Message:

Always set is_member/is_banned in get_group_extras(), also updates bp_group_is_user_banned() for these changes. Fixes #2960

File:
1 edited

Legend:

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

    r3540 r3541  
    10241024 *
    10251025 * If this function is invoked inside the groups template loop (e.g. the group directory), then
    1026  * $groups_template->group->is_banned is set if the user is banned, so use that instead of making
    1027  * another SQL query.
     1026 * check $groups_template->group->is_banned instead of making another SQL query.
     1027 * However, if used in a single group's pages, we must use groups_is_user_banned().
    10281028 *
    10291029 * @global object $bp BuddyPress global settings
     
    10341034 * @since 1.3
    10351035 */
    1036 function bp_group_is_user_banned( $group = false, $user_id = false ) {
     1036function bp_group_is_user_banned( $group = false, $user_id = 0 ) {
    10371037    global $bp, $groups_template;
    10381038
     
    10441044        $group =& $groups_template->group;
    10451045
    1046         if ( !$user_id && !empty( $group->is_banned ) )
    1047             return apply_filters( 'bp_group_is_member_banned', true );
     1046        if ( !$user_id && isset( $group->is_banned ) )
     1047            return apply_filters( 'bp_group_is_user_banned', $group->is_banned );
    10481048    }
    10491049
Note: See TracChangeset for help on using the changeset viewer.