Skip to content

Instantly share code, notes, and snippets.

Created February 23, 2012 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1895087 to your computer and use it in GitHub Desktop.
Save anonymous/1895087 to your computer and use it in GitHub Desktop.
Register connection type by remtheory
p2p_register_connection_type( array(
'name' => 'brand_to_product',
'from' => 'brand',
'to' => 'product'
) );
p2p_register_connection_type( array(
'name' => 'brand_to_store',
'from' => 'brand',
'to' => 'store'
) );
p2p_register_connection_type( array(
'name' => 'product_to_standard',
'from' => 'product',
'to' => 'standard'
) );
p2p_register_connection_type( array(
'name' => 'product_to_store',
'from' => 'product',
'to' => 'store'
) );
p2p_register_connection_type( array(
'name' => 'brand_to_standard',
'from' => 'brand',
'to' => 'standard'
) );
}
add_action( 'wp_loaded', 'my_connection_types' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment