groups_check_for_membership_request( int $user_id, int $group_id )

Check whether a user has an outstanding membership request for a given group.

Parameters Parameters


(int) (Required) ID of the user.


(int) (Required) ID of the group.

Top ↑

Return Return

(int|bool) ID of the request if found, otherwise false.

Source Source

File: bp-groups/bp-groups-functions.php

function groups_check_for_membership_request( $user_id, $group_id ) {
	if ( empty( $user_id ) || empty( $group_id ) ) {
		return false;

	$args = array(
		'user_id' => $user_id,
		'item_id' => $group_id,
	$invites_class = new BP_Groups_Invitation_Manager();

	return $invites_class->request_exists( $args );

Top ↑

Changelog Changelog

Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.