BP_Groups_Member::delete_all( int $group_id )

Delete all memberships for a given group.

Description

Parameters

$group_id

(Required) ID of the group.

Return

(int) Number of records deleted.

Source

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

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

		$bp = buddypress();

		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE group_id = %d", $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.