Support » Plugin: Posts 2 Posts » [Plugin: Posts 2 Posts] Register a Posts2posts connection via a Gravity Form?

  • I’ve created a Gravity form for users to submit associated resources to a training module. This is done through CPTs for ‘Associated Resources’ and ‘Training Modules’. The ‘Gravity Forms + Custom Posts Types’ plugin (love it!) manages the form posting to the CPT.

    The Associated Resources are associated through the Posts2Posts plugin (which is fabulous!). At the moment, a logged in user can make this association when editing the Training Module or Resources posts (great!) but they can’t make this association when uploading a new resource on the front end through the Gravity form (not so great).

    The user is able to input the Resource title, URL and type of file into the Gravity form and push the data to a new ‘Resource’ post, but I can’t figure out how the form can also register the Posts2Posts association.

    Any help? Please?

Viewing 6 replies - 1 through 6 (of 6 total)
  • hi there

    I think you will need to write some custom code for this. The best way is to hook into the ‘gform_post_submission’ action (this is what the GF+CPT plugin hooks into to save taxonomies for a post)

    add_action('gform_post_submission', 'link_posts');
    function link_posts( $entry, $form ) {
      $post_id = $entry['post_id'];
      foreach( $form['fields'] as &$field ) {
        //get values from form fields

    Thanks for the start. I might need to pull someone in on this- a bit hard for me.

    Any updates here? I am looking to do the same thing…

    Hey Jake,

    I don’t think this falls part of the Gravity forms + custom post type plugin. However, I am thinking about doing a separate plugin that does this linking, but it is not top of my list at the moment.

    What is the barebones functionality you are looking for and I will see what I can do

    Well, I would like the ability to generate a new post, and then at the same time, register connections for other posts. Like trickadee mentioned above, this can be done on the backend after a post is created, but I would like to keep this all on the frontend.

    Hi There,
    I still haven’t got this up and running, it’s a project I’ve parked for now. As Jake said, it’s about creating connections on the front end.
    If you do write something, please let me know!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Posts 2 Posts] Register a Posts2posts connection via a Gravity Form?’ is closed to new replies.