Skip to content

Commit

Permalink
Merge pull request #155 from 10up/fix/150
Browse files Browse the repository at this point in the history
Fix: Non admin can not crop avatar
  • Loading branch information
faisal-alvi authored Nov 28, 2022
2 parents 906e74d + d466098 commit d1000c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions includes/class-simple-local-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ public function add_hooks() {
return $strings;
}, 10, 1 );
}

// Fix: An error occurred cropping the image (https://github.com/10up/simple-local-avatars/issues/141).
if ( isset( $_POST['action'] ) && 'crop-image' === $_POST['action'] && is_admin() && wp_doing_ajax() ) {
add_action( 'plugins_loaded', function () {
remove_all_actions( 'setup_theme' );
} );
}
}

/**
Expand Down

0 comments on commit d1000c4

Please sign in to comment.