Title: [Plugin: Posts 2 Posts] Multiple connections getting crossed
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] Multiple connections getting crossed

 *  Resolved [owenwalz](https://wordpress.org/support/users/owenwalz/)
 * (@owenwalz)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-multiple-connections-getting-crossed/)
 * Hey, just upgraded to 1.0. Love it.
    Unfortunately, I have a small issue: A while
   back I registered a connection type between ‘Events’ and ‘People,’ (called ‘Credits),
   then filled in a ton of connections. No data type specified. Now I’ve added a
   second connection type between the same post types, called ‘Spotlight.’ I gave
   spotlight its own data type. Now, when I add a ‘Spotlight’ connection between
   events and people, I see it show up in the ‘Credits’ area as well. Seems there
   is a crossed wire somewhere.
 * Anything I can do? When I add a data type to the origina ‘Credits’ connection,
   I lose all the old connections in the meta box UI. Seems to treat it as a new
   registration.
 * Thanks,
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

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

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-multiple-connections-getting-crossed/#post-2407895)
 * I’m not sure what you mean by “data type”. Please post the calls to p2p_register_connection_type()
   that you have.
 *  Thread Starter [owenwalz](https://wordpress.org/support/users/owenwalz/)
 * (@owenwalz)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-multiple-connections-getting-crossed/#post-2407983)
 * This is the new type that I just added:
 *     ```
       p2p_register_connection_type( array(
       	    'from' => 'event',
       	    'id' => 'spotlight',
       	    'to' => array('event', 'person', 'news'),
       	    'title' => 'Spotlight',
       		'reciprocal' => false,
       		'data' => array( 'type' => 'spotlight'),
       		'show_ui' => 'from',
       		'sortable' => 'any',
       		'fields' => array(
       			'alt_title' => 'Alternate Title (Optional)'
       		)
       	) );
       ```
   
 * This was already registered and contains a lot of connections:
 *     ```
       p2p_register_connection_type( array(
               'from' => 'event',
               'to' => 'person',
       		'reciprocal' => true,
       		'sortable' => 'any',
       		'title' => array( 'from' => 'Cast & Crew', 'to' => 'Credits' ),
       		'fields' => array(
       		    'credit' => 'Credit',
       		    'credit_cat' => array(
       				'title' => 'Credit Category',
       				'values' => array( 'Playwright', 'Director', 'Assistant Director', 'Cast', 'Production' )
       				)
       	    )
       	) );
       ```
   
 * I would add `data' => array( 'type' => 'credit')` to this second type, but I 
   lose all my old connections when I do so.
 * Thanks,
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-multiple-connections-getting-crossed/#post-2407986)
 * You can take advantage of the fact that the older connection types have a ‘credit’
   field. You can add something like this to it:
 *     ```
       'to_query_vars' => array(
         'connected_meta' => array( array( 'key' => 'credit' ) )
       )
       ```
   
 *  Thread Starter [owenwalz](https://wordpress.org/support/users/owenwalz/)
 * (@owenwalz)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-multiple-connections-getting-crossed/#post-2407989)
 * Thanks. That’s been working well in my templates. To be more specific, I’m hoping
   to keep ‘spotlight’ connections showing up in the UI for ‘credit’ connections
   for types ‘person’.

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

The topic ‘[Plugin: Posts 2 Posts] Multiple connections getting crossed’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [owenwalz](https://wordpress.org/support/users/owenwalz/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-multiple-connections-getting-crossed/#post-2407989)
 * Status: resolved