Changeset 5821
- Timestamp:
- 02/21/2012 02:36:35 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-functions.php
r5796 r5821 471 471 /** 472 472 * When a user is deleted, we need to clean up the database and remove all the 473 * profile data from each table. Also we need to clean anything up in the usermeta table474 * that this component uses.473 * profile data from each table. Also we need to clean anything up in the 474 * usermeta table that this component uses. 475 475 * 476 476 * @package BuddyPress XProfile 477 477 * @param $user_id The ID of the deleted user 478 * @uses bp_get_user_meta() Get a user meta value based on meta key from wp_usermeta479 * @uses bp_delete_user_meta() Delete user meta value based on meta key from wp_usermeta480 * @uses delete_data_for_user() Removes all profile data from the xprofile tables for the user481 478 */ 482 479 function xprofile_remove_data( $user_id ) { 483 480 BP_XProfile_ProfileData::delete_data_for_user( $user_id ); 484 485 // delete any avatar files.486 @unlink( bp_get_user_meta( $user_id, 'bp_core_avatar_v1_path', true ) );487 @unlink( bp_get_user_meta( $user_id, 'bp_core_avatar_v2_path', true ) );488 489 // unset the usermeta for avatars from the usermeta table.490 bp_delete_user_meta( $user_id, 'bp_core_avatar_v1' );491 bp_delete_user_meta( $user_id, 'bp_core_avatar_v1_path' );492 bp_delete_user_meta( $user_id, 'bp_core_avatar_v2' );493 bp_delete_user_meta( $user_id, 'bp_core_avatar_v2_path' );494 481 } 495 482 add_action( 'wpmu_delete_user', 'xprofile_remove_data' );
Note: See TracChangeset
for help on using the changeset viewer.