Title: [Plugin: Posts 2 Posts] Reciprocal only working one way
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] Reciprocal only working one way

 *  Resolved [Kay](https://wordpress.org/support/users/kayheunen/)
 * (@kayheunen)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-reciprocal-only-working-one-way/)
 * Dear Scribu,
 * I’m having a reciprocal relationship between my custom post types: ‘diensten’
   and ‘projecten’. Using the following code:
 *     ```
       function my_connection_types() {
           // Make sure the Posts 2 Posts plugin is active.
           if ( !function_exists( 'p2p_register_connection_type' ) )
               return;
   
           // Keep a reference to the connection type; we'll need it later
           global $my_connection_type;
   
           $my_connection_type = p2p_register_connection_type( array(
               'from' => 'diensten',
               'to' => 'projecten',
               'reciprocal' => true
   
           ) );
       }
       add_action( 'init', 'my_connection_types', 100 );
       ```
   
 * However this seems to be alright. I’m only able to update the connection via 
   the custom post type ‘diensten’ (the from param). Though it shows up on the custom
   post type ‘projecten’ edit page, I’m able to delete a current relationship, but
   I’m not able to create a relationship (selecting one of the ‘diensten’ posts).
 * Could you help me, or tell me what I’m doing wrong?
 * Thanks in advance.
    Kind regards,
 * Kay Heunen
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

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

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-reciprocal-only-working-one-way/#post-2322991)
 * It works ok for me.
 * Could you explain what exactly happens when you try to make a connection from
   a ‘projecten’ post? A screenshot uploaded to imgur.com maybe?
 *  Thread Starter [Kay](https://wordpress.org/support/users/kayheunen/)
 * (@kayheunen)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-reciprocal-only-working-one-way/#post-2323000)
 * This is wat I’m doing.
 * 1. Go to projecten overview
    2. Edit a post 3. Click on the ‘view all’ in the
   connection box 4. Than I click on the ‘+’ to add the connection 5. I see a connection
   in the meta box 6. Than I hit Update/save 7. The connection is gone (or actually
   never sent to the db)
 * When I check my database I only see a one way relationship i.e.
    primaryId From
   To 1 489 909
 * Where as when I do it the other way around (edit a post in diensten) it does 
   this:
    primaryId From To 1 489 909 2 909 489
 * I’ve checked with other post types, nothing there..
 *  [argeee](https://wordpress.org/support/users/argeee/)
 * (@argeee)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-reciprocal-only-working-one-way/#post-2323006)
 * This is a [great little tool](http://www.techsmith.com/download/jing/) if you
   need to share a screenshot or record a short video of your actions on the screen.
 * I’m not related to them, but it has proven to be very useful for debugging over
   time.
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-reciprocal-only-working-one-way/#post-2323038)
 * Ok, I was able to reproduce this.
 * The problem was that the connection was stored as `projecten->diensten` instead
   of `diensten->projecten`.
 * Should be fixed in the [development version](http://downloads.wordpress.org/plugin/posts-to-posts.zip)(
   0.9.2-alpha).
 *  Thread Starter [Kay](https://wordpress.org/support/users/kayheunen/)
 * (@kayheunen)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-reciprocal-only-working-one-way/#post-2323044)
 * Dear Scribu,
 * Awesome, thanks for your quick reply and fix.
    I forked .9.2-alpha and the tabs
   aren’t working anymore, just wanted to let you know.
 * I took the stable plugin and changed your last two commits locally here, now 
   the tabs are working. Great plugin!!
 * Kind regards.
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-reciprocal-only-working-one-way/#post-2323047)
 * The tabs don’t work because you have to generate the JavaScript file:
 * [https://github.com/scribu/wp-posts-to-posts/wiki/Development-guide](https://github.com/scribu/wp-posts-to-posts/wiki/Development-guide)
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-reciprocal-only-working-one-way/#post-2323050)
 * I added admin/box.js to the git repo so that you don’t have to build it yourself,
   when you just want to test.

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

The topic ‘[Plugin: Posts 2 Posts] Reciprocal only working one way’ 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/)

 * 7 replies
 * 3 participants
 * Last reply from: [scribu](https://wordpress.org/support/users/scribu/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-reciprocal-only-working-one-way/#post-2323050)
 * Status: resolved