Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created January 11, 2012 16:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/1595618 to your computer and use it in GitHub Desktop.
Save billerickson/1595618 to your computer and use it in GitHub Desktop.
Posts 2 Posts - list connections
<?php
/**
* List Speakers
* Used on Schedule page to list speakers connected to session
*
* @author Bill Erickson
* @link http://www.billerickson.net/code/posts-2-posts-list-connections
*/
function be_list_speakers() {
if( function_exists( 'p2p_list_posts' ) ) {
$connected = p2p_type( 'sessions_to_speakers')-> get_connected( $post->ID );
p2p_list_posts( $connected, array(
'before_list' => '<p>by ',
'after_list' => '</p>',
'before_item' => '',
'after_item' => ' ',
) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment