bp_group_has_membership_requests( array|string $args = '' )

Initialize a group membership request template loop.

Description

Parameters

$args

(array|string) (Optional)

  • 'group_id'
    (int) ID of the group. Defaults to current group.
  • 'per_page'
    (int) Number of records to return per page. Default: 10.
  • 'page'
    (int) Page of results to return. Default: 1.
  • 'max'
    (int) Max number of items to return. Default: false.

Default value: ''

Return

(bool) True if there are requests, otherwise false.

Source

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

function bp_group_has_membership_requests( $args = '' ) {
	global $requests_template;

	$r = bp_parse_args( $args, array(
		'group_id' => bp_get_current_group_id(),
		'per_page' => 10,
		'page'     => 1,
		'max'      => false
	), 'group_has_membership_requests' );

	$requests_template = new BP_Groups_Membership_Requests_Template( $r );

	/**
	 * Filters whether or not a group membership query has requests to display.
	 *
	 * @since BuddyPress 1.1.0
	 *
	 * @param bool                                   $value             Whether there are requests to display.
	 * @param BP_Groups_Membership_Requests_Template $requests_template Object holding the requests query results.
	 */
	return apply_filters( 'bp_group_has_membership_requests', $requests_template->has_requests(), $requests_template );
}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.