Is there an easy way to have it upload an image and post content and that image be its post thumbnail automatically?
Is there an easy way to have it upload an image and post content and that image be its post thumbnail automatically?
Wondering the same thing ... anybody?
This isn't currently a native feature. It is something we plan on adding in a future release. It is possible to do now but requires custom code and the use of available API hooks.
Here is an example:
http://forum.gravityhelp.com/topic/auto-setting-the-the_post_thumbnail?replies=6#post-17879
Hello
Here is a simple code that makes a post thumbnail (featured image in Wordpress 3.2) from first photo attached to the post.
add_action("gform_post_submission", "my_post_submission", 10, 2);
function my_post_submission($entry, $form){
# Here you should check if $form is the right form, otherwise it will work for all forms.
$post = get_post($entry["post_id"]);
$arrImages =& get_children('post_type=attachment&post_mime_type=image&post_parent=' . $entry["post_id"] );
if(is_array($arrImages)) {
foreach ($arrImages as $attachment_id => $Image) {
set_post_thumbnail( $post, $attachment_id );
break;
}
}
}