Skip to:
Content

BuddyPress.org

Ticket #6681: 6681.diff

File 6681.diff, 1.2 KB (added by henry.wright, 6 years ago)
  • src/bp-members/bp-members-functions.php

    diff --git src/bp-members/bp-members-functions.php src/bp-members/bp-members-functions.php
    index 0475e0a..0821d62 100644
    add_action( 'wpmu_delete_user', 'bp_core_delete_avatar_on_user_delete' ); 
    13951395add_action( 'delete_user', 'bp_core_delete_avatar_on_user_delete' );
    13961396
    13971397/**
     1398 * Delete a user's notifications when the user is deleted.
     1399 *
     1400 * @since 2.4.0
     1401 *
     1402 * @param int $user_id ID of the user who is about to be deleted.
     1403 *
     1404 * @return int|bool The number of rows updated or false on error.
     1405 */
     1406function bp_core_delete_notifications_on_user_delete( $user_id ) {
     1407
     1408        return BP_Notifications_Notification::delete( array(
     1409                'user_id'           => $user_id,
     1410                'item_id'           => false,
     1411                'secondary_item_id' => false,
     1412                'component_action'  => false,
     1413                'component_name'    => false
     1414        ) );
     1415}
     1416add_action( 'wpmu_delete_user', 'bp_core_delete_notifications_on_user_delete' );
     1417add_action( 'delete_user', 'bp_core_delete_notifications_on_user_delete' );
     1418
     1419/**
    13981420 * Multibyte-safe ucfirst() support.
    13991421 *
    14001422 * Uses multibyte functions when available on the PHP build.