WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] Returns all connection, regardless of direction (5 posts)

  1. Derek Perkins
    Member
    Posted 4 years ago #

    For most of my connections, I don't care whether I connected the object 'from' or 'to' the other. I'd like to see when I'm editing a post any posts that are connected, regardless where the connection was made from.

    Also, I'd like to be able to call a function from the API that returns all the connections without regard to direction. I know that the way that it currently works, I can just call the p2p_get_connected function twice, but that seems awkward.

    Related, what if a connection is made both from and to? That seems like double effort.

  2. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    For most of my connections, I don't care whether I connected the object 'from' or 'to' the other. I'd like to see when I'm editing a post any posts that are connected, regardless where the connection was made from.

    You can do this:

    p2p_register_connection_type( 'post_type_a', 'post_type_b', true );

    Notice the third parameter.

    Related, what if a connection is made both from and to? That seems like double effort.

    Yes, it has a certain overhead, but it avoids inconsistencies.

    Also, I'd like to be able to call a function from the API that returns all the connections without regard to direction. I know that the way that it currently works, I can just call the p2p_get_connected function twice, but that seems awkward.

    I've added that option in the development version (0.4-alpha2)

  3. Derek Perkins
    Member
    Posted 4 years ago #

    Thanks for the quick response. I have been using the third parameter as true, I must have just not checked for it to display on both sides of the connection since I upgraded to 0.3.

    I've added that option in the development version (0.4-alpha2)

    When do you expect to release 0.4?

  4. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    You can already use it as is (see the link).

    I don't have a feature plan for 0.4 so I don't know when that will be.

  5. Derek Perkins
    Member
    Posted 4 years ago #

    I'm using it and it's working like a charm. Thanks so much for your quick response and lightning fast implementation.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic