マジ便利やで。
posts 2 posts が まぁ幅広ーくなったかんじ。
// function my_connection_types() {
// Make sure the Posts 2 Posts plugin is active.
if ( !function_exists( 'p2p_register_connection_type' ) )
return;
// Keep a reference to the connection type; we'll need it later
global $people_connection_type;
global $place_connection_type;
global $event_connection_type;
$place_connection_type = p2p_register_connection_type( array(
'from' => 'events',
'to' => 'places'
) );
$people_connection_type = p2p_register_connection_type( array(
'from' => 'events',
'to' => 'people'
) );
$event_connection_type = p2p_register_connection_type( array(
'from' => 'people',
'to' => 'places'
) );
}
add_action( 'init', 'my_connection_types', 100 );