Created
September 1, 2015 00:21
-
-
Save halfempty/792ba7ba811448754327 to your computer and use it in GitHub Desktop.
Sample Posts 2 Posts + The Event Calendar connections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Connections | |
*/ | |
function clock_p2p_register_connections() { | |
p2p_register_connection_type( array( | |
'name' => 'posts_to_tribe_events', | |
'from' => 'post', | |
'to' => 'tribe_events', | |
'title' => array( | |
'from' => __( 'Related Events' ), | |
'to' => __( 'Related Posts' ) | |
) | |
) ); | |
p2p_register_connection_type( array( | |
'name' => 'tribe_events_to_tribe_events', | |
'from' => 'tribe_events', | |
'to' => 'tribe_events', | |
'reciprocal' => true, | |
'title' => array( | |
'from' => __( 'Related Events' ), | |
'to' => __( 'Related Events' ) | |
) | |
) ); | |
} | |
add_action( 'p2p_init', 'clock_p2p_register_connections' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment