Created
July 2, 2012 20:31
-
-
Save eddiemoya/3035527 to your computer and use it in GitHub Desktop.
Allow non-image mime-types in the multiple featured image plugin
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
// In function kd_meta_box_output() replace | |
$thumbnail = wp_get_attachment_image( $image_id, array( 266, 266 ) ); | |
//With... | |
$type = get_post_mime_type($iamge_id); | |
$icon = in_array($type, array('application/pdf')) ? true : false; | |
$thumbnail = wp_get_attachment_image( $image_id, array( 266, 266 ), $icon ); | |
// And in function kd_ajax_set_image(), replace | |
$thumb_html = wp_get_attachment_image( $thumb_id, 'thumbnail', $icon); | |
//With... | |
$type = get_post_mime_type($thumb_id); | |
$icon = in_array($type, array('application/pdf'))? true : false; | |
$thumb_html = wp_get_attachment_image( $thumb_id, 'thumbnail', $icon); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment