Skip to:
Content

BuddyPress.org

Changeset 7572


Ignore:
Timestamp:
11/15/2013 08:33:51 PM (10 years ago)
Author:
boonebgorges
Message:

Delete user avatar on user deletion.

Fixes #5044. Fixes #5242.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-functions.php

    r7570 r7572  
    926926    return $retval;
    927927}
     928
     929/**
     930 * Delete a user's avatar when the user is deleted.
     931 *
     932 * @since BuddyPress (1.9.0)
     933 *
     934 * @param int $user_id ID of the user who is about to be deleted.
     935 * @return bool True on success, false on failure.
     936 */
     937function bp_core_delete_avatar_on_user_delete( $user_id ) {
     938    return bp_core_delete_existing_avatar( array(
     939        'item_id' => $user_id,
     940        'object'  => 'user',
     941    ) );
     942}
     943add_action( 'wpmu_delete_user', 'bp_core_delete_avatar_on_user_delete' );
     944add_action( 'delete_user', 'bp_core_delete_avatar_on_user_delete' );
    928945
    929946/**
Note: See TracChangeset for help on using the changeset viewer.