Posts 2 Posts
[resolved] "Warning: Could not find direction(s)" error (3 posts)

  1. jtwg
    Posted 3 years ago #

    I can't seem to solve this issue.

    Here's the registration of the connection:


    When I am in the edit screen for the case study post type, and connect the endorsement, that works and makes the following record in the p2p table:
    from: case study ID
    to: endorsement ID
    name: case-study_to_endorsement

    And the query parameters used to attempt to retrieve the connected endorsement are:
    Array ( [post_type] => endorsement [orderby] => menu_order [numberposts] => 1 [order] => ASC [post_status] => publish [connected_type] => case-study_to_endorsement )

    But the result is:
    Warning: Could not find direction(s). in /home/*****/wp-content/plugins/posts-to-posts/core/query-post.php on line 16

    Any advice would be greatly appreciated, thanks.


  2. jtwg
    Posted 3 years ago #

    Disregard due to PEBCAK.

  3. Marco Panichi
    Posted 3 years ago #

    Add a connection_direction value to your WP_Query arguments

    $connected = new WP_Query( array(
      'connected_direction' => 'from',  // <<<--- IT IS NEEDED!
      'connected_type' => 'A_toB',
      'connected_items' => get_queried_object(),
      'nopaging' => true,
    ) );

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


No tags yet.