<?php
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 $my_connection_type;
$my_connection_type = p2p_register_connection_type( array(
‘from’ => ‘post’,
‘to’ => ‘osobe’,
‘fields’ => array(
‘uloga’ => ‘uloga:’,
‘lik’ => ‘lik:’
),
‘reciprocal’ => true,
‘prevent_duplicates’ => false,
));
$my_connection_type = p2p_register_connection_type( array(
‘from’ => ‘osobe’,
‘to’ => ‘filmovi’,
‘fields’ => array(
‘uloga’ => ‘uloga:’,
‘lik’ => ‘lik:’
),
‘reciprocal’ => true,
‘prevent_duplicates’ => false,
));
}
add_action( ‘init’, ‘my_connection_types’, 100 );?>