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

461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
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.