BP_Groups_Group::get_membership_requests( int $group_id, int|null $limit = null, int|null $page = null )

Get outstanding membership requests for a group.


Parameters Parameters

$group_id

(int) (Required) ID of the group.

$limit

(int|null) (Optional) Max number of results to return. Default: null (no limit).

Default value: null

$page

(int|null) (Optional) Page offset of results returned. Default: null (no limit).

Default value: null


Top ↑

Return Return

(array)

  • 'requests'
    (array) The requested page of located requests.
  • 'total'
    (int) Total number of requests outstanding for the group.


Source Source

File: bp-groups/classes/class-bp-groups-group.php

	public static function get_membership_requests( $group_id, $limit = null, $page = null ) {
		$args = array(
			'item_id' => $group_id
		);
		if ( $limit ) {
			$args['per_page'] = $limit;
		}
		if ( $page ) {
			$args['page'] = $page;
		}

		$requests = groups_get_requests( $args );
		$total    = count( groups_get_membership_requested_user_ids( $group_id ) );

		return array( 'requests' => $requests, 'total' => $total );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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