Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/21/2017 10:37:23 PM (2 years ago)
Author:
r-a-y
Message:

Groups: Add fine-grained querying of invite sent status in groups_get_invites_for_group().

This commit introduces a new $sent parameter to groups_get_invites_for_group()
and BP_Groups_Group::get_invites(). With this parameter, developers can
now query group invites by sent status or not.

See #7397.

File:
1 edited

Legend:

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

    r11603 r11604  
    16261626 *
    16271627 * @since 1.0.0
    1628  *
    1629  * @param int $user_id  ID of the inviting user.
    1630  * @param int $group_id ID of the group.
    1631  * @return array $value IDs of users who have been invited to the group by the
    1632  *                      user but have not yet accepted.
    1633  */
    1634 function groups_get_invites_for_group( $user_id, $group_id ) {
    1635     return BP_Groups_Group::get_invites( $user_id, $group_id );
     1628 * @since 2.9.0 Added $sent as a parameter.
     1629 *
     1630 * @param  int      $user_id  ID of the inviting user.
     1631 * @param  int      $group_id ID of the group.
     1632 * @param  int|null $sent     Query for a specific invite sent status. If 0, this will query for users
     1633 *                            that haven't had an invite sent to them yet. If 1, this will query for
     1634 *                            users that have had an invite sent to them. If null, no invite status will
     1635 *                            queried. Default: null.
     1636 * @return array    IDs of users who have been invited to the group by the user but have not
     1637 *                  yet accepted.
     1638 */
     1639function groups_get_invites_for_group( $user_id, $group_id, $sent = null ) {
     1640    return BP_Groups_Group::get_invites( $user_id, $group_id, $sent );
    16361641}
    16371642
Note: See TracChangeset for help on using the changeset viewer.