Last active
March 25, 2019 13:01
-
-
Save MjHead/1660d4d54f8a300a53fbae22ef18a2f5 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
/** | |
* Show image by stored image ID | |
* | |
* $meta_key - custom field to get image from | |
* $size - image size to show | |
*/ | |
function jet_admin_column_date( $column, $post_id ) { | |
$meta_key = '_image'; | |
$image_id = get_post_meta( $post_id, $meta_key, true ); | |
$size = 'thumbnail'; | |
if ( ! $image_id ) { | |
return '--'; | |
} else { | |
return wp_get_attachment_image( $image_id, $size ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment