// Eerst file als WP media attachment zetten
// Nu als post thumbnail zetten
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' );
if ( !empty( $thumbnail_html ) ) {
update_post_meta( $post_ID, '_thumbnail_id', $thumbnail_id );
die( _wp_post_thumbnail_html( $thumbnail_id ) );
}
}
// TODO: zet postmeta voor je bericht het file id of iets dergelijks dat je dit niet dubbel of vaker gaat doen