I have custom plugin which registers multiple CPT's and i want to reuse the features of wp-posts-to-posts to define relationships. I'm just wondering what is the correct/best way to include the api.php file within my own plugin?
function my_connection_types() {
require_once( ABSPATH . 'wp-content/plugins/posts-to-posts/core/api.php' );
// Make sure the Posts 2 Posts plugin is active.
if ( !function_exists( 'p2p_register_connection_type' ) )
return;
p2p_register_connection_type( array(
'name' => 'events_to_races',
'from' => 'event',
'to' => 'race',
'cardinality' => 'one-to-many'
) );
}

