gform_after_submission add list of form titles after the post content [closed]

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:

$id_of_page = 36; // change this

// false means we want all values as array, not single
$array_of_submitters = get_post_meta($id_of_page, 'my_custom_field', false); 

if(empty($array_of_submitters)){
    // has not yet been made, setup variable
    $array_of_submitters = array();
}

// add new value to array
$array_of_submitters[] = $entry[12]; // whatever field you need

// update!
update_post_meta($id_of_page, 'my_custom_field', $array_of_submitters);

Then in your page, you’ll want to just echo those out like this:

$array_of_submitters = get_post_meta($post->ID, 'my_custom_field', false);

// make sure it has values first so we don't look foolish
if(!empty($array_of_submitters)){
    echo '<h4>People who did something</h4>';
    echo '<ul>';
        // echo each value out as list
        foreach($array_of_submitters as $submitter){
            echo '<li>'.$submitter.'</li>'; 
        }
    echo '</ul>';
}