Changeset 7943 for trunk/bp-core/bp-core-avatars.php
- Timestamp:
- 02/20/2014 09:27:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-avatars.php
r7769 r7943 751 751 752 752 // Delete the existing avatar files for the object 753 bp_core_delete_existing_avatar( array( 'object' => $object, 'avatar_path' => $avatar_folder_dir ) ); 753 $existing_avatar = bp_core_fetch_avatar( array( 754 'object' => $object, 755 'item_id' => $item_id, 756 'html' => false, 757 ) ); 758 759 if ( ! empty( $existing_avatar ) ) { 760 // Check that the new avatar doesn't have the same name as the 761 // old one before deleting 762 $upload_dir = wp_upload_dir(); 763 $existing_avatar_path = str_replace( $upload_dir['baseurl'], '', $existing_avatar ); 764 $new_avatar_path = str_replace( $upload_dir['basedir'], '', $original_file ); 765 766 if ( $existing_avatar_path !== $new_avatar_path ) { 767 bp_core_delete_existing_avatar( array( 'object' => $object, 'avatar_path' => $avatar_folder_dir ) ); 768 } 769 } 770 771 754 772 755 773 // Make sure we at least have a width and height for cropping
Note: See TracChangeset
for help on using the changeset viewer.