Filter the original Photon image parameters before Photon is applied to an image.
Parameters
- $args
(array | string) Array of Photon arguments.
- $image_url
string Image URL.
- $scheme
(string | null) Image scheme. Default to null.
Changelog
- Introduced in Jetpack 1.9.0
How to use this hook
Notes
You can use this filter to change the Photon parameters used for images on your site, like so:
function jeherve_custom_photon( $args ) {
$args['quality'] = 80;
$args['strip'] = 'all';
$args['filter'] = 'grayscale';
return $args;
}
add_filter( 'jetpack_photon_pre_args', 'jeherve_custom_photon' );