He encontrado este código que, si bien no consigue todas las miniaturas de todos los post, al menos no produce errores:
Código PHP:
Ver originalffunction autoset_featured( $new_status, $old_status, $post ) {
if( $new_status != 'publish' ) return;
$already_has_thumb = has_post_thumbnail($post->ID);
if (!$already_has_thumb) {
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {
set_post_thumbnail($post->ID, $attachment_id);
}
}
}
}
add_action( 'transition_post_status', 'autoset_featured', 10, 3 );