Skip to content

Reciprocal connections

scribu edited this page Sep 18, 2011 · 21 revisions

When registering a connection type, you can set the 'reciprocal' flag:

	$my_connection_type = p2p_register_connection_type( array( 
		'from' => 'post',
		'to' => 'page',
		'reciprocal' => true
	) );

This will make the connections box also show up when editing a page.

Now you can create a connection from either place and it will show up in both.

Note that the connection is stored only once in the database: post → page.

Clone this wiki locally