Title: [Plugin: Posts 2 Posts] Widget in admin not finding connection
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] Widget in admin not finding connection

 *  Resolved [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/)
 * I have 3 connections widget box for my post in admin.
 * First connection box works perfectly when typing first few letter (automatically
   finds related) or when using the View all link.
 * My other 2 widget box don’t work when starting typing, only the View all links
   will display the full list of connected post.
 * any idea?
 * thx
    s
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

Viewing 15 replies - 16 through 30 (of 30 total)

[←](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/?output_format=md)
[1](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/?output_format=md)
2

 *  Thread Starter [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397402)
 * [http://pastebin.com/yLqXn5GG](http://pastebin.com/yLqXn5GG)
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397404)
 * Ok, so the ‘client’ role has the ‘edit_offers’ capability, right?
 *  Thread Starter [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397405)
 * yes they do, they can post/edit offers.
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397409)
 * This code works fine for me, on WP 3.2.1, with the development version I last
   linked to:
 *     ```
       add_action( 'init', 'init_stuff' );
   
       function init_stuff() {
       	register_post_type( 'company', array(
       		'public' => true,
       		'label' => 'Companies',
       		'capability_type' => 'company'
       	) );
   
       	register_post_type( 'offer', array(
       		'public' => true,
       		'label' => 'Offers',
       		'capability_type' => 'offer'
       	) );
   
       	p2p_register_connection_type(array(
       		'id' => 'posts_to_offer',
       		'from' => 'post',
       		'to' => 'offer',
       		'reciprocal' => true
       	));
   
       	p2p_register_connection_type(array(
       		'id' => 'company_to_offer',
       		'from' => 'company',
       		'to' => 'offer',
       		'reciprocal' => true
       	));
       }
       ```
   
 * If you’re using a plugin to register the post types, disable it and try the above
   code instead.
 * If it still doesn’t work, it means there’s some other plugin interfering.
 *  Thread Starter [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397418)
 * Thanks scribu
    I will have a look at this tomorrow
 * Thx Again for your support, not sure how you manage but you are a rare one that
   everybody needs.
 * I will be more than happy to contribute to a nice xmas present or a beer fund
   if you have something set up somewhere
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397431)
 * You’re welcome. The beer fund is at [http://scribu.net/paypal](http://scribu.net/paypal)
   🙂
 *  Thread Starter [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397526)
 * me again sorry…
 * Whatever I try, same issue.
 * Only Admin seem to be able to Connect a post to a Custom Post Type (Offer or 
   Destination).
 * Editor or in my case Client, even with the correct rights set up in Adminize,
   cannot link a Post to a Custom post type.
 * I cant understand what’s wrong.
 * HELP…please 🙁
 *  Thread Starter [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397527)
 * trying to debug, and the console throws the errors here
    [http://pastebin.com/55FHrYNm](http://pastebin.com/55FHrYNm)
 * `if (!response.rows) {`
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397528)
 * Did you try deactivating all other plugins?
 * Did you try the code I posted last time?
 * Are you on the development version (1.0.1-alpha2)?
 *  Thread Starter [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397547)
 * Ok some update on this.
 * Running version (1.0.1-alpha2)
 * Using your code above APART from Capability type of my Custom Post Type.
    In 
   your code you wrote ‘capability_type’ => ‘company’ In my code I have ‘capability_type’
   => ‘page’
 * If I change it Company, I lose my CPT in dashboard.
 * Running all this, I only get the Connected Post metabox (no Company or Destination).
   
   puzzled….
 *  Thread Starter [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397549)
 * Just realized something.
 * Offers = Post
    Destination = Pages.
 * Connection works from Post to Offer (reciprocal)
 * Connection dont work from Post to Destination (capability page)
 * which is normal, as your plugin is called POSTS 2 POSTS….
 * BUT, why can I create the connections when logged in as an ADMIN?
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397550)
 * >  Connection dont work from Post to Destination (capability page)
   > which is normal, as your plugin is called POSTS 2 POSTS…
 * That is incorrect. It should work between _any_ post type, with any capability
   setting (as long as the user’s role has the appropriate capabilities).
 * Have you tried deactivating all other plugins, like I suggested? Also might be
   a good idea to switch to the bundled theme.
 *  Thread Starter [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397551)
 * I did deactivate the plugins. not results.
 * I am glad the connection works between CPT (posts or pages) and posts.
 * In your code, why is the capability_type is set to the same name as the post 
   type?
    I thought only a Type of Post or Page can be set there? (if i change this,
   I lose my CPT) s
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397552)
 * Listen, how about we talk via IRC? I’m in the #wordpress channel on freenode.
 *  Thread Starter [salocined](https://wordpress.org/support/users/salocined/)
 * (@salocined)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397553)
 * Finally fixed it thx to Scribu.
 * My CPT had Page capability and my client didnt have permission to edit Pages,
   hence the box not working.
    Removing the capability_type for my CPT fixed my 
   issue.

Viewing 15 replies - 16 through 30 (of 30 total)

[←](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/?output_format=md)
[1](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/?output_format=md)
2

The topic ‘[Plugin: Posts 2 Posts] Widget in admin not finding connection’ 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/)

 * 30 replies
 * 2 participants
 * Last reply from: [salocined](https://wordpress.org/support/users/salocined/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-widget-in-admin-not-finding-connection/page/2/#post-2397553)
 * Status: resolved