Changeset 10819 for trunk/src/bp-groups/bp-groups-functions.php
- Timestamp:
- 05/28/2016 09:02:10 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-functions.php
r10795 r10819 1542 1542 * @param string $type Optional. Use 'sent' to check for sent invites, 1543 1543 * 'all' to check for all. Default: 'sent'. 1544 * @return bool True if an invitation isfound, otherwise false.1544 * @return int|bool ID of the membership if found, otherwise false. 1545 1545 */ 1546 1546 function groups_check_user_has_invite( $user_id, $group_id, $type = 'sent' ) { 1547 return BP_Groups_Member::check_has_invite( $user_id, $group_id, $type ); 1547 $invite = false; 1548 1549 $args = array( 1550 'is_confirmed' => false, 1551 'is_banned' => null, 1552 'is_admin' => null, 1553 'is_mod' => null, 1554 ); 1555 1556 if ( 'sent' === $type ) { 1557 $args['invite_sent'] = true; 1558 } 1559 1560 $user_groups = bp_get_user_groups( $user_id, $args ); 1561 1562 if ( isset( $user_groups[ $group_id ] ) && 0 !== $user_groups[ $group_id ]->inviter_id ) { 1563 $invite = $user_groups[ $group_id ]->id; 1564 } 1565 1566 return $invite; 1548 1567 } 1549 1568 … … 1890 1909 * @param int $user_id ID of the user. 1891 1910 * @param int $group_id ID of the group. 1892 * @return int| null ID of the membership if found, otherwise false.1911 * @return int|bool ID of the membership if found, otherwise false. 1893 1912 */ 1894 1913 function groups_check_for_membership_request( $user_id, $group_id ) { 1895 return BP_Groups_Member::check_for_membership_request( $user_id, $group_id ); 1914 $request = false; 1915 1916 $user_groups = bp_get_user_groups( $user_id, array( 1917 'is_confirmed' => false, 1918 'is_banned' => false, 1919 'is_admin' => null, 1920 'is_mod' => null 1921 ) ); 1922 1923 if ( isset( $user_groups[ $group_id ] ) && 0 === $user_groups[ $group_id ]->inviter_id ) { 1924 $request = $user_groups[ $group_id ]->id; 1925 } 1926 1927 return $request; 1896 1928 } 1897 1929
Note: See TracChangeset
for help on using the changeset viewer.