Skip to content

Instantly share code, notes, and snippets.

@scribu
Created November 24, 2012 17:19
Show Gist options
  • Select an option

  • Save scribu/4140592 to your computer and use it in GitHub Desktop.

Select an option

Save scribu/4140592 to your computer and use it in GitHub Desktop.
P2P collect post types
foreach ( P2P_Connection_Type_Factory::get_all_instances() as $p2p_type => $ctype ) {
$post_types = array();
foreach ( $ctype->side as $direction => $side ) {
if ( 'post' == $side->get_object_type() ) {
$post_types[ $direction ] = $side->query_vars['post_type'];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment