bp_delete_user_meta

Delete a piece of usermeta.

Description

bp_delete_user_meta( (int) $user_id, (string) $key, (string) $value = '' ); 

This is a wrapper for delete_user_meta() that allows for easy use of bp_get_user_meta_key(), thereby increasing compatibility with non-standard BP setups.

Parameters (3)

0. $user_id (int)
The ID of the user whose meta you're deleting.
1. $key (string)
The meta key to delete.
2. $value — Optional. (string) => ''
Metadata value.

Usage

  1. if ( !function_exists( 'bp_delete_user_meta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-functions.php'; 
  3.  
  4. // The ID of the user whose meta you're deleting. 
  5. $user_id = -1; 
  6.  
  7. // The meta key to delete. 
  8. $key = ''; 
  9.  
  10. // Optional. Metadata value. 
  11. $value = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bp_delete_user_meta($user_id, $key, $value); 
  15.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-functions.php  
  1. function bp_delete_user_meta( $user_id, $key, $value = '' ) { 
  2. return delete_user_meta( $user_id, bp_get_user_meta_key( $key ), $value );