• Resolved jtwg

    (@jtwg)


    I can’t seem to solve this issue.

    Here’s the registration of the connection:

    p2p_register_connection_type(array(
    ‘from’=>’case-study’,
    ‘to’=>’endorsement’,
    ‘name’=>’case-study_to_endorsement’
    ));

    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.

    https://www.ads-software.com/extend/plugins/posts-to-posts/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jtwg

    (@jtwg)

    Disregard due to PEBCAK.

    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,
    ) );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Posts 2 Posts] "Warning: Could not find direction(s)" error’ is closed to new replies.