BP_XProfile_Field::delete_for_group( int $group_id )
Delete all fields in a field group.
Description Description
Parameters Parameters
- $group_id
-
(Required) ID of the field group to delete fields from.
Return Return
(boolean)
Source Source
File: bp-xprofile/classes/class-bp-xprofile-field.php
public static function delete_for_group( $group_id = 0 ) { global $wpdb; // Bail if no group ID. if ( empty( $group_id ) ) { return false; } $bp = buddypress(); $sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE group_id = %d", $group_id ); $deleted = $wpdb->get_var( $sql ); // Return true if fields were deleted. if ( false !== $deleted ) { return true; } return false; }
Changelog Changelog
Version | Description |
---|---|
1.2.0 | Introduced. |