Skip to:
Content

BuddyPress.org

Ticket #8617: 8617.diff

File 8617.diff, 868 bytes (added by sbrajesh, 3 years ago)
  • src/bp-core/classes/class-bp-attachment-avatar.php

    diff --git a/src/bp-core/classes/class-bp-attachment-avatar.php b/src/bp-core/classes/class-bp-attachment-avatar.php
    index 2887f33e2..83469dba4 100644
    a b class BP_Attachment_Avatar extends BP_Attachment { 
    257257                 * Check that the new avatar doesn't have the same name as the
    258258                 * old one before moving the previous one into history.
    259259                 */
    260                 if ( ! empty( $existing_avatar ) && $existing_avatar !== $this->url . $relative_path ) {
     260                if ( apply_filters( 'bp_enable_avatar_revision', true, $args['object'], $args['item_id'] ) && ! empty( $existing_avatar ) && $existing_avatar !== $this->url . $relative_path ) {
    261261                        // Add a new revision for the existing avatar.
    262262                        $avatars = bp_attachments_list_directory_files( $avatar_folder_dir );
    263263