WordPress.org

Forums

Posts 2 Posts
[resolved] Reciprocal connection (2 posts)

  1. qwik3r
    Member
    Posted 4 years ago #

    I have the latest .04 alpha build, trying to generate a reciprocal connection I suppose.

    I create a connection between 2 custom post types: p2p_register_connection_type('events', 'locations', true);

    This allows me to connect locations to events. However I would like to output all events that are currently connected to that location on the location page, so I would assume it would be the reverse however I am unsure how to do this, can you please advise?

  2. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    $posts = get_posts( array(
      'suppress_filters' => false,
      'connected_to' => $event_id,
      'post_type' => 'location'
    ) );

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