WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] After updating to 1.4.1 get_connected doesn't work (3 posts)

  1. Marko Heijnen
    Member
    Posted 2 years ago #

    I did run 1.4 alpha ( commit c55565a0b0 ) and updated today to 1.4.1. Now it can't determine direction of the type.

    I try to get all the connection through:
    $objects = p2p_type( 'object_to_chain' )->get_connected( 'chain', $args, 'abstract' );

    Is the code changed? or I'm doing it wrong?

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

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    'chain' is not a valid parameter anymore (and never should have been). Use 'any'.

    If that doesn't work, call set_direction() manually:

    $objects = p2p_type( 'object_to_chain' )->set_direction( 'to' )->get_connected( 'any', $args, 'abstract' );
  3. Marko Heijnen
    Member
    Posted 2 years ago #

    chain was a post type and yes it was wrong. That code works perfect

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.