WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jtwg
    Member
    Posted 1 year ago #

    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.

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

  2. jtwg
    Member
    Posted 1 year ago #

    Disregard due to PEBCAK.

  3. Marco Panichi
    Member
    Posted 10 months 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

About this Topic

Tags

No tags yet.