Created
January 21, 2015 22:53
-
-
Save devinsays/8dce79e5c946dd8f76dc to your computer and use it in GitHub Desktop.
Photon Experiments - Image Quality
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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