Skip to content

Instantly share code, notes, and snippets.

@jawngee
Last active February 2, 2019 04:02
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 jawngee/533a1bd4998115c3aae96d91e5fa81a0 to your computer and use it in GitHub Desktop.
Save jawngee/533a1bd4998115c3aae96d91e5fa81a0 to your computer and use it in GitHub Desktop.
Imgix parameters
<?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