wp-posts-to-posts icon indicating copy to clipboard operation
wp-posts-to-posts copied to clipboard

How to differentiate between duplicate connections

Open Pollux321 opened this issue 8 years ago • 0 comments

I'm trying to differentiate between duplicate connections. I make a duplicate connections of two posts on seperate pages that result in seperate p2p_id's but I have no way of differentiating between them when I want to disconnect a specific one or get that connections meta data.

On page 1 I have a connection between post A and post B with connection meta data of 'structure_id' equaling the ID of page 1. I also give the connection the 'date' field and value of time the connection was created.

On page 2 I have another connection between post A and post B that has a different p2p_ID and a different 'structure_id' that is the ID of page 2 along with the date.

What doesn't work...

p2p_type( $connectionName )->disconnect( $postA, $postB, array(
    'structure_id' => $structure_id
));

I need a simple way to use the connection meta to differentiate between duplicate connections when all I have is the connection meta data, connection name, and ID's of the two posts.

Pollux321 avatar Apr 05 '17 19:04 Pollux321