BP_Groups_Group::has_membership_requests( int $group_id )

Check whether a group has outstanding membership requests.

Description

Parameters

$group_id

(int) (Required) ID of the group.

Return

(int|null) The number of outstanding requests, or null if none are found.

Source

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

	public static function has_membership_requests( $group_id ) {
		global $wpdb;

		$bp = buddypress();

		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0", $group_id ) );
	}

Changelog

Changelog
Version Description
BuddyPress 1.6.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.