Duplicate connections and cardinality
Clone this wiki locally
By default, after you connect post A to post B, post B disappears from the list of candidate posts.
If you want to be able to create multiple connections between the same posts, just set
p2p_register_connection_type( array( ... 'duplicate_connections' => true ) );
The default cardinality is many-to-many. This means that a post can connect to many other pages and a page can connect to many other posts.
You can change this, however:
p2p_register_connection_type( array( ... 'from' => 'post', 'to' => 'page', 'cardinality' => 'one-to-many' ) );
Now, a post can still connect to many other pages, but a page can connect to only one post.
This can be reversed also using many-to-one.