Last active
February 2, 2019 04:02
-
-
Save jawngee/533a1bd4998115c3aae96d91e5fa81a0 to your computer and use it in GitHub Desktop.
Imgix parameters
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 | |
add_filter('ilab-imgix-filter-parameters', function($params, $size, $id, $meta) { | |
// $params contains the imgix parameters | |
// $size is either an array of two numbers for width/height, or it is the name of a size | |
// $id is the attachment ID | |
// $meta is the attachment's meta | |
if (!is_array($size) && ($size == 'download')) { | |
// Full size | |
unset($params['w']); | |
unset($params['h']); | |
unset($params['fit']); | |
$parms['q'] = 100; | |
} | |
return $params; | |
}, 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment