Thanks to Rinat for this Plugin!
And thx also to you, Guy! Moving “do_action( ‘fu_after_create_post’, $post_id )” into _handle_result worked for me, too (from line 325 to 424 in v 0.5.9.2)
This code in functions.php just makes the first uploaded image the post thumbnail:
add_action( 'fu_after_create_post', 'fu_attach_thumbnail' );
function fu_attach_thumbnail( $post_id ) {
$args = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'post_parent' => $post_id
);
$images = get_posts( $args );
if($images) {
$image=array_shift($images);
set_post_thumbnail( $post_id, $image->ID );
}
foreach($images as $image):
// do something with the other attached images...
endforeach;
}
The other uploaded images could become a gallery or so…?