BP_XProfile_Field::delete_for_group( int $group_id )

Delete all fields in a field group.


Parameters Parameters

$group_id

(int) (Required) ID of the field group to delete fields from.


Top ↑

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;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.