Title: [Plugin: Posts 2 Posts] User to post issue
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] User to post issue

 *  Resolved [mendelk](https://wordpress.org/support/users/mendelk/)
 * (@mendelk)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-user-to-post-issue/)
 * Hi Scribu.
 * First of all, thnx again for a great plugin and great support.
 * Q:
    I created a user TO posts connection, and now I get a “Warning: Can’t determine
   direction” when I attempt p2p_type( ‘YOUR_CONNECTION_TYPE’ )->get_p2p_id( $user_id,
   $post_id )
 * Any ideas what I’m doing wrong?
 * [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)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-user-to-post-issue/#post-2953510)
 * You should pass a user object (A), or set the direction manually (B):
 *     ```
       A) $ctype->get_p2p_id( get_userdata( $user_id ), $post_id )
       ```
   
 *     ```
       B)  $ctype->set_direction( 'to' )->get_p2p_id( $user_id, $post_id )
       ```
   
 *  Thread Starter [mendelk](https://wordpress.org/support/users/mendelk/)
 * (@mendelk)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-user-to-post-issue/#post-2953613)
 * Thank you and I can confirm that both options work.
 * I have to confess to not understanding why this is, as this is a user-to-post
   connection (not user-to-user), so why can’t the direction be determined?
 * When the order is reversed (post-to-user), it does give the correct information,
   even with just the user id, and not the user object.
 * Anyways, thank you!
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-user-to-post-issue/#post-2953617)
 * When you pass an ID as the first argument, it always expects that it’s a post,
   since you can have both a post and a user with the same id.
 * Passing full objects avoids this ambiguity, since it can determine if it’s dealing
   with a user or a post.
 *  Thread Starter [mendelk](https://wordpress.org/support/users/mendelk/)
 * (@mendelk)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-user-to-post-issue/#post-2953620)
 * Aha ok, got it!

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

The topic ‘[Plugin: Posts 2 Posts] User to post issue’ 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: [mendelk](https://wordpress.org/support/users/mendelk/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-user-to-post-issue/#post-2953620)
 * Status: resolved