xprofile_admin_delete_group( int $group_id )

Handles the deletion of profile data groups.

Description

Parameters

$group_id

(Required) ID of the group to delete.

Source

File: bp-xprofile/bp-xprofile-admin.php

function xprofile_admin_delete_group( $group_id ) {
	global $message, $type;

	check_admin_referer( 'bp_xprofile_delete_group' );

	$group = new BP_XProfile_Group( $group_id );

	if ( !$group->delete() ) {
		$message = __( 'There was an error deleting the field set. Please try again.', 'buddyboss' );
		$type    = 'error';
	} else {
		$message = __( 'The field set was deleted successfully.', 'buddyboss' );
		$type    = 'success';

		/**
		 * Fires at the end of group deletion process, if successful.
		 *
		 * @since BuddyPress 1.0.0
		 *
		 * @param BP_XProfile_Group $group Current BP_XProfile_Group object.
		 */
		do_action( 'xprofile_groups_deleted_group', $group );
	}

	xprofile_admin_screen( $message, $type );
}

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.