scribu/wp-posts-to-posts — Issue #79: Trying to get just ID of connected page/user/post
Author: landwire
Created: 2011-12-09 10:16:41+00:00
State: open

Hi there,
I am struggling to just get the ID of a (or many!!!) connected post from the ID of the current page. Could you show me what to use? I tried the following with p2p_get_connections, but did not succeed:

ID;
echo $post_id;
$args = array(
'direction' => 'from',
'from' => $post_id,
'to' => 'any',
'fields' => 'all'
);
$myconnections = p2p_get_connections ('posts_to_pages');
//$connectedpagesid = $myconnections -> 'p2p_to';
var_dump ($myconnections);
?>

Thank you!