Title: [Plugin: Posts 2 Posts] Register a Posts2posts connection via a Gravity Form?
Last modified: August 20, 2016

---

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

 *  [trickadee](https://wordpress.org/support/users/trickadee/)
 * (@trickadee)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/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?
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [bradvin](https://wordpress.org/support/users/bradvin/)
 * (@bradvin)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-register-a-posts2posts-connection-via-a-gravity-form/#post-2581934)
 * 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
         }
       }
       ```
   
 *  Thread Starter [trickadee](https://wordpress.org/support/users/trickadee/)
 * (@trickadee)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-register-a-posts2posts-connection-via-a-gravity-form/#post-2582067)
 * Thanks for the start. I might need to pull someone in on this- a bit hard for
   me.
 *  [Jake Spurlock](https://wordpress.org/support/users/whyisjake/)
 * (@whyisjake)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-register-a-posts2posts-connection-via-a-gravity-form/#post-2582152)
 * Any updates here? I am looking to do the same thing…
 *  [bradvin](https://wordpress.org/support/users/bradvin/)
 * (@bradvin)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-register-a-posts2posts-connection-via-a-gravity-form/#post-2582153)
 * 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
 *  [Jake Spurlock](https://wordpress.org/support/users/whyisjake/)
 * (@whyisjake)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-register-a-posts2posts-connection-via-a-gravity-form/#post-2582154)
 * Well, I would like the ability to generate a new post, and then at the same time,
   register connections for other posts. Like [trickadee](http://wordpress.org/support/topic/plugin-posts-2-posts-register-a-posts2posts-connection-via-a-gravity-form?replies=5#post-2635815)
   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.
 *  Thread Starter [trickadee](https://wordpress.org/support/users/trickadee/)
 * (@trickadee)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-register-a-posts2posts-connection-via-a-gravity-form/#post-2582155)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [trickadee](https://wordpress.org/support/users/trickadee/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-register-a-posts2posts-connection-via-a-gravity-form/#post-2582155)
 * Status: not resolved