BP_XProfile_ProfileData::delete()
Delete specific XProfile field data.
Description Description
Return Return
(boolean)
Source Source
File: bp-xprofile/classes/class-bp-xprofile-profiledata.php
public function delete() {
global $wpdb;
$bp = buddypress();
/**
* Fires before the current profile data instance gets deleted.
*
* @since 1.9.0
*
* @param BP_XProfile_ProfileData $this Current instance of the profile data being deleted.
*/
do_action_ref_array( 'xprofile_data_before_delete', array( $this ) );
$deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $this->field_id, $this->user_id ) );
if ( empty( $deleted ) ) {
return false;
}
/**
* Fires after the current profile data instance gets deleted.
*
* @since 1.9.0
*
* @param BP_XProfile_ProfileData $this Current instance of the profile data being deleted.
*/
do_action_ref_array( 'xprofile_data_after_delete', array( $this ) );
return true;
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |