Title: [Plugin: Posts 2 Posts] Connecting posts within multisite environment
Last modified: August 19, 2016

---

# [Plugin: Posts 2 Posts] Connecting posts within multisite environment

 *  Resolved [Troy Chaplin](https://wordpress.org/support/users/areziaal/)
 * (@areziaal)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-connecting-posts-within-multisite-environment/)
 * Firstly, a big thank you for this fantastic plugin scribu! The ideas and possibilities
   generated from this will go a long way in increasing front end usability and 
   backend functionality!
 * I’m wondering if there’s any way, or anything planned for a future release, to
   be able to create post type connections within a multisite environment?
 * I was hoping to find a way to connect a set of entries in one custom post type
   in one site to a custom post type within another site.
 * Thanks,
    Troy

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

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-connecting-posts-within-multisite-environment/#post-1876096)
 * It’s doable, but it’s not even on my todo list at the moment.
 *  [Youdaman](https://wordpress.org/support/users/youdaman/)
 * (@youdaman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-connecting-posts-within-multisite-environment/#post-1876296)
 * Just thought I’d add my 2 cents in case anyone else finds this page via googling…
 * Awesome plugin scribu, thanks very much 🙂
 * I’ve discovered that if I do a network activation of the plugin on a multiuser
   installation the relationships between posts aren’t stored — the default storage
   for the plugin is in the “wp_p2p” table whereas for multisite it would be in 
   a “wp_X_p2p” table, where X is the site number.
 * The quick solution is to enable the plugin on a per-site basis instead of for
   the entire multisite network.
 * The other way is to tweak the plugin to work for multisite, which I might look
   into now 🙂
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-connecting-posts-within-multisite-environment/#post-1876299)
 * And the third way is to use [Proper Network Activation](http://wordpress.org/extend/plugins/proper-network-activation/)
   😉
 *  [Youdaman](https://wordpress.org/support/users/youdaman/)
 * (@youdaman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-connecting-posts-within-multisite-environment/#post-1876303)
 * Awesome work (as usual) scribu, thank you very much 🙂
 * I installed Proper Network Activation and it works, but I came across a couple
   of possible bugs:
 * 1. upon activation, the notification on the plugin screen says it had been activated
   for 0/3 of my sites — I’m guessing this is meant to be an AJAX thing that increments
   as it activates for each site? The first time I tried I was too quick to activate
   another plugin and hadn’t let it activate for the third site (the p2p table for
   that site was missng), but then I tried again and it activated correctly (the
   p2p table was present for that site), but yeah the message still said “0/3” sites.
   A minor aesthetic issue really 🙂
 * 2. I attempted to create another site, but got the following PHP error:
 * `[17-Feb-2011 02:15:43] PHP Fatal error: Cannot redeclare p2p_get_meta() (previously
   declared in /var/www/venuepress.com/html/wp-content/plugins/posts-to-posts/storage.
   php:159) in /var/www/venuepress.com/html/wp-content/plugins/posts-to-posts/storage.
   php on line 161`
 * When I went back to my site listing page, the site had indeed been created even
   though there had been the above error, but of course the p2p functionality didn’t
   work because the p2p table for that new site wasn’t created.
 * I’ll have a look at the code/line mentioned above to see if I can’t offer some
   help — I really like your plugins!
 *  [Youdaman](https://wordpress.org/support/users/youdaman/)
 * (@youdaman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-connecting-posts-within-multisite-environment/#post-1876304)
 * I found a solution — I changed each instance of “require” to “require_once” in
   posts-to-posts.php:
 *     ```
       require_once dirname( __FILE__ ) . '/scb/load.php';
   
       function _p2p_init() {
           load_plugin_textdomain( 'posts-to-posts', '', dirname( plugin_basename( __FILE__ ) ) . '/lang' );
   
           require_once dirname( __FILE__ ) . '/storage.php';
           require_once dirname( __FILE__ ) . '/api.php';
           require_once dirname( __FILE__ ) . '/ui/ui.php';
           require_once dirname( __FILE__ ) . '/ui/boxes.php';
       ```
   
 * I was then able to create a new site in my network, and everything seemed to 
   be working fine 🙂
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-connecting-posts-within-multisite-environment/#post-1876306)
 * 1. Fixed now in the [development version](http://downloads.wordpress.org/plugin/proper-network-activation.zip)
   of Proper Network Activation (1.0.3-alpha).
 * 2. Yeah, I keep forgetting to do that. Fixed now in the [development version](http://downloads.wordpress.org/plugin/posts-to-posts.zip)
   of Posts 2 Posts (0.5.2-alpha).
 * Thanks for reporting.
 *  [Youdaman](https://wordpress.org/support/users/youdaman/)
 * (@youdaman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-connecting-posts-within-multisite-environment/#post-1876308)
 * Excellent! I’m now rocking with your development versions. Thanks 🙂

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

The topic ‘[Plugin: Posts 2 Posts] Connecting posts within multisite environment’
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: [Youdaman](https://wordpress.org/support/users/youdaman/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-connecting-posts-within-multisite-environment/#post-1876308)
 * Status: resolved