Skip to content

Commit

Permalink
Merge pull request #255 from 10up/tweak/199-move-action
Browse files Browse the repository at this point in the history
Tweak/199 Move `simple_local_avatar_deleted` action to `avatar_delete`
  • Loading branch information
dkotter authored Jan 18, 2024
2 parents 55cfa94 + 34342e0 commit 4c6319c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions includes/class-simple-local-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -1132,15 +1132,6 @@ public function action_remove_simple_local_avatar() {

$this->avatar_delete( $user_id ); // delete old images if successful

/**
* Enable themes and other plugins to react to avatar deletions.
*
* @since 2.6.0
*
* @param int $user_id Id of the user who's avatar was deleted.
*/
do_action( 'simple_local_avatar_deleted', $user_id );

if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
echo wp_kses_post( get_simple_local_avatar( $user_id ) );
}
Expand Down Expand Up @@ -1204,6 +1195,15 @@ public function avatar_delete( $user_id ) {

delete_user_meta( $user_id, $this->user_key );
delete_user_meta( $user_id, $this->rating_key );

/**
* Enable themes and other plugins to react to avatar deletions.
*
* @since 2.6.0
*
* @param int $user_id Id of the user who's avatar was deleted.
*/
do_action( 'simple_local_avatar_deleted', $user_id );
}

/**
Expand Down

0 comments on commit 4c6319c

Please sign in to comment.