BP_XProfile_ProfileData::delete_for_field( int $field_id )

Delete field.

Description

Parameters

$field_id

(int) (Required) ID of the field to delete.

Return

(bool)

Source

File: bp-xprofile/classes/class-bp-xprofile-profiledata.php

	public static function delete_for_field( $field_id ) {
		global $wpdb;

		$bp      = buddypress();
		$deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d", $field_id ) );
		if ( empty( $deleted ) || is_wp_error( $deleted ) ) {
			return false;
		}

		return true;
	}

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.