Skip to content

Instantly share code, notes, and snippets.

@UmeshSingla
Created November 2, 2016 14:12
Show Gist options
  • Save UmeshSingla/4450f47512bd8a0419406e904660a992 to your computer and use it in GitHub Desktop.
Save UmeshSingla/4450f47512bd8a0419406e904660a992 to your computer and use it in GitHub Desktop.
Allows you to skip given image ids from Smushing ( Bulk/Manual Smush )
<?php
function skip_smush( $smush, $attachment ) {
//Attachment ids that needs to be skipped
if( 116 == $attachment || in_array( $attachment, array(117, 118, 119, 132, 137, 170 ) ) ) {
return false;
}
return $smush;
}
add_filter( 'wp_smush_image', 'skip_smush', '', 2 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment