PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Multiple posts generated by one form

  1. I need to create a form capable of creating multiple posts (each in their own category). I found something about gform_post_submission, but it's not clear to me whether this means what I want is possible. Can you help me further along?

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  2. David Peralty

    You could create your own PHP code to write multiple WordPress posts from one form submission, but this isn't supported by Gravity Forms and would require a fair bit of custom code. You could use gform_after_submission (gform_post_submission is deprecated) to do this, but beyond that, there isn't much I can do to help you with this other than to say that you'll want to look at how to write a WordPress post using PHP.

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  3. That's a shame. Time and my customer's budget will not allow me to delve into creating it all myself.. What happened to the Advanced Post Creation add-on that was being built a few years back?

    Is there another way? Is it possible somehow to create conditional fields based on values of a different form?

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  4. David Peralty

    I don't know of any other way currently to make multiple posts from one submission without a great deal of custom code. All my best...

    Posted 11 years ago on Thursday February 14, 2013 | Permalink
  5. Somebody managed to get it work? I think that it is very interesting feature to create for example a simple post of 30 fields Curricullum Vitae of some Job Applicant and use 5 fields to automaticaly create a new user for custom post type "mailing_list. "
    Another example is to create club custom post type "EVENT" with club location fields and then in the background create a new custom post type "CLUB" info.
    Is it hard to create in the background e new custom post type CLUB entry with some 3-5 fields one per line?
    Can you provide an example as you have provided here: ?
    http://www.gravityhelp.com/documentation/page/Gform_after_submission

    Very amateur example below:

    <?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 = "Club Info: "<br/> " . $entry[1] . " <br/>
     "<br/> " . $entry[2] . " <br/>
     "<br/> " . $entry[3] . " <br/>
     "<br/> " . $entry[4] . " <br/>
     "<br/> " . $entry[5] . " <br/>
    
        //updating post
        wp_update_post($post);
    }
    ?>
    Posted 11 years ago on Friday June 21, 2013 | Permalink