Skip to content

Instantly share code, notes, and snippets.

View jbma's full-sized avatar

Jean-Baptiste Marchand-Arvier jbma

View GitHub Profile
<?php
add_action( 'admin_init', '__remove_imagify_notice' )
function __remove_imagify_notice() {
remove_filter( 'admin_notices', '_imagify_rocket_notice' );
}
<?php
require('wp-load.php');
echo '<pre>;
print_r(wp_remote_get("https://app.imagify.io/api/version"));
@jbma
jbma / exclude.php
Last active January 15, 2018 15:31
<?php
function __imagify_exclude($attachment_id){
if (in_array(23, 34,439)){
return false;
}
return true;
}
add_filter( 'imagify_auto_optimize_attachment', '__imagify_exclude' );
@jbma
jbma / webp-gif.php
Created November 13, 2019 14:27
WebP Gif
<?php
function no_webp_for_gif( $response, $process, $file, $thumb_size, $optimization_level, $webp, $is_disabled ) {
if ( ! $webp || $is_disabled || is_wp_error( $response ) ) {
return $response;
}
if ( 'image/gif' !== $file->get_mime_type() ) {
return $response;
}