Created
November 2, 2016 14:12
-
-
Save UmeshSingla/4450f47512bd8a0419406e904660a992 to your computer and use it in GitHub Desktop.
Allows you to skip given image ids from Smushing ( Bulk/Manual Smush )
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 | |
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