Skip to content

Instantly share code, notes, and snippets.

@thomasgriffin
Last active November 2, 2018 19:51
Show Gist options
  • Save thomasgriffin/4262025 to your computer and use it in GitHub Desktop.
Save thomasgriffin/4262025 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'jpeg_quality', 'tgm_image_full_quality' );
add_filter( 'wp_editor_set_quality', 'tgm_image_full_quality' );
/**
* Filters the image quality for thumbnails to be at the highest ratio possible.
*
* Supports the new 'wp_editor_set_quality' filter added in WP 3.5.
*
* @since 1.0.0
*
* @param int $quality The default quality (90).
* @return int $quality Amended quality (100).
*/
function tgm_image_full_quality( $quality ) {
return 100;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment