scribu/wp-posts-to-posts — Issue #30: New method of registering multiple connection types
Author: baden03
Created: 2011-10-15 19:39:37+00:00
State: open

The old recommended method of connecting multiple post types was as follows:

p2p_register_connection_type( 'director', 'film', true);
p2p_register_connection_type( 'director', 'award', true);
p2p_register_connection_type( 'film', 'monkey', true);

but now are we suppose to set this as a variable like so?

$my_connection_type = p2p_register_connection_type(
array(
'from' => 'director',
'to' => array('film', 'award'),
'reciprocal' => true
),
array(
'from' => film,
'to' => monkey,
'reciprocal' => true
),
);

It's just that the examples on "Registering a connection type" do not clearly explain how to register multiple connections that require multiple p2p_register_connection_type calls.