remove_accents does not seem to work (when used inside sanitize_file_name filter)

I’ve just got an advice on Twitter from Daniel Střelec to simply use sanitize_title – which is a better solution anyway, as it removes whitespace and other non-ideal characters for filename. Use it this way: add_filter(‘sanitize_file_name’, ‘sanitize_title’); I’m keeping the question opened though, as what I’ve described above sounds like a WP bug to me. … Read more

Disable all resizing and compression

Turns out I was never too far off. Adding this to your functions.php will stop all resizing and compression of images uploaded to the media folder add_filter( ‘big_image_size_threshold’, ‘__return_false’ ); add_filter( ‘jpeg_quality’, function($arg){return 100;} ); update_option( ‘medium_size_w’, 9000 ); update_option( ‘medium_size_h’, 9000 ); update_option( ‘large_size_w’, 9000 ); update_option( ‘large_size_h’, 9000 ); Hope this helps someone … Read more

Unable to check if image uploaded by wp_image_editor exists using file_exists function

When I used your exact code on a local test site I was unable to save the resized image. This is because you’re passing a URL to wp_get_image_editor() instead of a path. You’re also passing a URL to pathinfo(), which also requires a path. $pathinfo = pathinfo( $uploaded[‘url’] ); $image = wp_get_image_editor( $uploaded[‘url’] ); The … Read more