Skip to content

Instantly share code, notes, and snippets.

@devinsays
Created January 21, 2015 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devinsays/8dce79e5c946dd8f76dc to your computer and use it in GitHub Desktop.
Save devinsays/8dce79e5c946dd8f76dc to your computer and use it in GitHub Desktop.
Photon Experiments - Image Quality
<?php
/**
* Plugin Name: Photon Experiments
* Description: Experimenting with Photon parameters.
* Version: 0.1.0
*/
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) :
function photon_experiments() {
add_filter( 'jetpack_photon_post_image_args', 'photon_experiments_quality', 100, 2 );
}
add_action( 'plugins_loaded', 'photon_experiments', 20 );
/*
* Change Photon image quality to 80%.
*
* @link https://developer.wordpress.com/docs/photon/api/#quality
*/
function photon_experiments_quality( $args, $image ) {
$args['quality'] = 80;
return $args;
}
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment