-
Notifications
You must be signed in to change notification settings - Fork 262
Duplicate connections and cardinality
scribu edited this page Nov 24, 2011
·
7 revisions
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 'prevent_duplicates'
to false
:
p2p_register_connection_type( array(
...
'prevent_duplicates' => false
) );
The default cardinality is many-to-many. This means that post A 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 have only one page connected to it.