Changeset 9944
- Timestamp:
- 06/15/2015 05:54:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-actions.php
r9819 r9944 27 27 function xprofile_action_delete_avatar() { 28 28 29 if ( ! bp_is_user_change_avatar() || !bp_is_action_variable( 'delete-avatar', 0 ) )29 if ( ! bp_is_user_change_avatar() || ! bp_is_action_variable( 'delete-avatar', 0 ) ) { 30 30 return false; 31 } 31 32 32 33 // Check the nonce 33 34 check_admin_referer( 'bp_delete_avatar_link' ); 34 35 35 if ( ! bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) )36 if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) { 36 37 return false; 38 } 37 39 38 if ( bp_core_delete_existing_avatar( array( 'item_id' => bp_displayed_user_id() ) ) ) 40 if ( bp_core_delete_existing_avatar( array( 'item_id' => bp_displayed_user_id() ) ) ) { 39 41 bp_core_add_message( __( 'Your profile photo was deleted successfully!', 'buddypress' ) ); 40 else42 } else { 41 43 bp_core_add_message( __( 'There was a problem deleting your profile photo. Please try again.', 'buddypress' ), 'error' ); 44 } 42 45 43 46 bp_core_redirect( wp_get_referer() );
Note: See TracChangeset
for help on using the changeset viewer.