Gform after submission

<?php
add_action("gform_after_submission", "set_post_content", 10, 2);
function set_post_content($entry, $form){

//getting post
$post = get_post($entry["post_id"]);

//changing post content
$post->post_content = "Blender Version:" . $entry[7] . "<br/> <img src='" . $entry[8] . "'> <br/> <br/> " . $entry[13] . " <br/> <img src='" . $entry[5] . "'>";

//updating post
wp_update_post($post);
}
?>

2 Comments

You must be logged in to post a comment.


  1. Do a printn_r($entry) to see all the entry data , then you can update the lost however you want. Have not looked at a gf post in a while, might just be $entry[1]


  2. Hello Adam, do you happily know how to add only title (with link to the new created CPT post) and insert it after the post content div in the current post? For me titles of the form represents names of submitters and I wanted to get a list of all submitters of little CPT forms in the current post page. I have put the question here using this code (the same as yours) from gravity forms documentation pages : http://wordpress.stackexchange.com/questions/103064/gform-after-submission-add-list-of-form-titles-after-the-post-content and also to gravity help support forum, till now no answer :(