Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/02/2011 08:55:26 PM (14 years ago)
Author:
boonebgorges
Message:

Fixes group invitations so that they work when JavaScript is disabled. Fixes #2245. Moves bp_groups_sent_invited_email hook inside invitation loop so that it's actually sent for each invited member.

File:
1 edited

Legend:

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

    r4230 r4324  
    525525        return false;
    526526
    527     if ( !groups_is_user_member( $user_id, $group_id ) && !groups_check_user_has_invite( $user_id, $group_id ) ) {
     527    if ( !groups_is_user_member( $user_id, $group_id ) && !groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) {
    528528        $invite                = new BP_Groups_Member;
    529529        $invite->group_id      = $group_id;
     
    628628}
    629629
    630 function groups_check_user_has_invite( $user_id, $group_id ) {
    631     return BP_Groups_Member::check_has_invite( $user_id, $group_id );
     630/**
     631 * Check to see whether a user has already been invited to a group
     632 *
     633 * By default, the function checks for invitations that have been sent. Entering 'all' as the $type
     634 * parameter will return unsent invitations as well (useful to make sure AJAX requests are not
     635 * duplicated)
     636 *
     637 * @package BuddyPress Groups
     638 *
     639 * @param int $user_id Potential group member
     640 * @param int $group_id Potential group
     641 * @param str $type Optional. Use 'sent' to check for sent invites, 'all' to check for all
     642 * @return bool Returns true if an invitation is found
     643 */
     644function groups_check_user_has_invite( $user_id, $group_id, $type = 'sent' ) {
     645    return BP_Groups_Member::check_has_invite( $user_id, $group_id, $type );
    632646}
    633647
Note: See TracChangeset for help on using the changeset viewer.