Ejemplo n.º 1
0
function xprofile_delete_field_group($field_group_id)
{
    $field_group = new BP_XProfile_Group($field_group_id);
    return $field_group->delete();
}
Ejemplo n.º 2
0
function xprofile_admin_delete_group($group_id)
{
    global $message, $type;
    $group = new BP_XProfile_Group($group_id);
    if (!$group->delete()) {
        $message = __('There was an error deleting the group. Please try again', 'buddypress');
        $type = 'error';
    } else {
        $message = __('The group was deleted successfully.', 'buddypress');
        $type = 'success';
        do_action('xprofile_groups_deleted_group', $group);
    }
    unset($_GET['mode']);
    xprofile_admin($message, $type);
}
/**
 * Handles the deletion of profile data groups.
 *
 * @param int $group_id ID of the group to delete.
 */
function xprofile_admin_delete_group($group_id)
{
    global $message, $type;
    $group = new BP_XProfile_Group($group_id);
    if (!$group->delete()) {
        $message = __('There was an error deleting the group. Please try again.', 'buddypress');
        $type = 'error';
    } else {
        $message = __('The group was deleted successfully.', 'buddypress');
        $type = 'success';
        /**
         * Fires at the end of group deletion process, if successful.
         *
         * @since 1.0.0
         *
         * @param BP_XProfile_Group $group Current BP_XProfile_Group object.
         */
        do_action('xprofile_groups_deleted_group', $group);
    }
    unset($_GET['mode']);
    xprofile_admin($message, $type);
}