WordPress.org

Forums

Posts 2 Posts
[resolved] Get connected "from" instead of "to"? (2 posts)

  1. jtwg
    Member
    Posted 2 years ago #

    I have a post type called customer, and another called case-study. Each customer can have multiple case studies connected to it. The connection type is case-study_to_customer. I'm trying to get a list of customers, with their connected case studies.

    I'm using WP_Query to get the customers, and then I am using WP_Query to get the case studies, passing the following parameters in the array:

    'connected_type'=>'case-study_to_customer',
    'connected_items'=>$customer_query_object

    This second query fails with an error: "Could not find direction(s)."

    Does p2p support retrieving related records like this? If not, what is a better way of doing it?

    http://wordpress.org/extend/plugins/posts-to-posts/

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    Just add 'connected_direction' => 'from'.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.