images-via-imgix icon indicating copy to clipboard operation
images-via-imgix copied to clipboard

Restrict imgix to specific filetype

Open jacquesletesson opened this issue 7 years ago • 1 comments

On numerous project we use animated-gif within Wordpress.

The plugin currently replace every images (despite the filetype) with Imgix instance.

Knowing that animated gif support is still a beta feature of Imgix, it would be awesome to have some sort of filetype restriction within the administration panel.

Right now, we hacked our way into the plugin to avoid any disturbance.

jacquesletesson avatar Jan 20 '18 09:01 jacquesletesson

Basically we edited line 98 of class-images-via-imgix.php into this :

if ( isset( $parsed_url['host'], $parsed_url['path'] ) && $parsed_url['host'] === parse_url( home_url( '/' ), PHP_URL_HOST ) && preg_match( '/\.(jpg|jpeg|png)$/', $parsed_url['path'] ) ) {

jacquesletesson avatar Jan 20 '18 13:01 jacquesletesson