Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Allow non-image mime-types in the multiple featured image plugin

View MFI_more_mime_types.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// 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
Something went wrong with that request. Please try again.