Hi.
I can't find any documentation on the $form element.
I would like to see some examples on how to use this within a gform_post_submission hook function..
is there any further documentation on using gforms in your functions.php file?
Hi.
I can't find any documentation on the $form element.
I would like to see some examples on how to use this within a gform_post_submission hook function..
is there any further documentation on using gforms in your functions.php file?
Expanded developer documentation and an all new documentation area will launch once we are done with the extensive changes we are making.
Here is an example of the gform_post_submission hook to change the post content, adding values from submitted fields, including an image field. This is an example of using the form object with the gform_post_submission hook.
<?php
add_action("gform_post_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);
}
?>
Here is documentation on the form object:
http://s3.amazonaws.com/gravityforms/documentation/gform_form_object.pdf
Here is documentation on the gform_post_submission hook:
http://s3.amazonaws.com/gravityforms/documentation/gform_post_submission.pdf