Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Allow non-image mime-types in the multiple featured image plugin
// In function kd_meta_box_output() replace
$thumbnail = wp_get_attachment_image( $image_id, array( 266, 266 ) );
$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);
$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
You can’t perform that action at this time.