-
-
Save jawngee/36c104f8a8b8ea7e7f6b0f0b837affa5 to your computer and use it in GitHub Desktop.
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 | |
// Add this to your theme's functions.php | |
// This filter will insure that the wp-image-{IMAGEID} class is added to your | |
// image tags, allowing media cloud to work more optimally | |
add_filter('wp_get_attachment_image_attributes', function($attrs, $attachment, $size) { | |
if (!empty($attachment) && isset($attrs['class'])) { | |
$attrs['class'] .= ' wp-image-'.$attachment->ID; | |
} | |
return $attrs; | |
}, PHP_INT_MAX, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment