Skip to:
Content

BuddyPress.org

Changeset 5673


Ignore:
Timestamp:
02/01/2012 07:30:35 PM (8 years ago)
Author:
djpaul
Message:

Add filter to bp_group_statusmessage. Fixes #3975, props sboisvert for initial patch.

File:
1 edited

Legend:

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

    r5500 r5673  
    16041604    }
    16051605
    1606 function bp_group_status_message( $group = false ) {
     1606/**
     1607 * Prints a message if the group is not visible to the current user (it is a
     1608 * hidden or private group, and the user does not have access).
     1609 *
     1610 * @global BP_Groups_Template $groups_template Groups template object
     1611 * @param object $group Group to get status message for. Optional; defaults to current group.
     1612 * @since 1.0
     1613 */
     1614function bp_group_status_message( $group = null ) {
    16071615    global $groups_template;
    16081616
    1609     if ( !$group )
     1617    if ( ! $group )
    16101618        $group =& $groups_template->group;
    16111619
    16121620    if ( 'private' == $group->status ) {
    1613         if ( !bp_group_has_requested_membership() )
     1621        if ( ! bp_group_has_requested_membership() ) {
    16141622            if ( is_user_logged_in() )
    1615                 _e( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
     1623                $message = __( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
    16161624            else
    1617                 _e( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
    1618         else
    1619             _e( 'This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress' );
     1625                $message = __( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
     1626
     1627        } else {
     1628            $message = __( 'This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress' );
     1629        }
     1630
    16201631    } else {
    1621         _e( 'This is a hidden group and only invited members can join.', 'buddypress' );
    1622     }
     1632        $message = __( 'This is a hidden group and only invited members can join.', 'buddypress' );
     1633    }
     1634
     1635    echo apply_filters( 'bp_group_status_message', $message, $group );
    16231636}
    16241637
Note: See TracChangeset for help on using the changeset viewer.