Created
January 11, 2012 16:56
-
-
Save billerickson/1595606 to your computer and use it in GitHub Desktop.
Posts 2 Posts - create connection
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 | |
add_action( 'init', 'be_post_type_connections' ); | |
/** | |
* Post Type Connection | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/code/posts-2-posts-create-connection | |
* | |
* @uses Posts2Posts | |
* @link https://github.com/scribu/wp-posts-to-posts/wiki | |
*/ | |
function be_post_type_connections() { | |
// Make Sure plugin is active | |
if ( !function_exists( 'p2p_register_connection_type' ) ) | |
return; | |
p2p_register_connection_type( array( | |
'name' => 'sessions_to_speakers', // unique name | |
'from' => 'sc-sessions', // post type slug | |
'to' => 'sc-speakers' // post type slug | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment