Can you help me with the code where all I only want is to add the list of all submitters who submitted GF form on every post page right after the post content?
Every post has its small CPT form on the bottom of the page and submitted forms goes to the custom post type portfolio page. I want to also display the list of clickable titles (the name of submitters with some fields already merged together by GF form) of the form with URL of that created page.
image 1 before submition:
The post after 5 succesfull submitions, it should also be after the post content /div
image 2 after:
The code I would like to use is here:
<?php
add_action("gform_after_submission_7", "set_post_content", 10, 2);
function set_post_content($entry, $form){
//getting post
$post = get_post($entry["post_id"]);
//adding after the post content - how can I get something like this ?:
ul
li
a submitted portfolio URL
div class"some class"
submitted form title
/div
/a
/li
/ul
//updating post
wp_update_post($post);
}
?>
In order to do this on the page where the form is, it would work well to know the ID of that page. We’ll assume you have that and just want to embed this information into this page. So in your
gform_after_submission
hook, you’ll want something like this:Then in your page, you’ll want to just echo those out like this: