The current way of getting connected posts is rather hard to read:
$posts_ids = p2p_type( 'posts_to_pages' )->get_connected( $post_id, array( 'fields' => 'ids' ) )->posts;
Much more familiar would be:
$query = new WP_Query( array(
'connected_type' => 'posts_to_pages',
'connected_posts' => $post_id,
'fields' => 'ids'
) );
$post_ids = $query->posts;
The current way of getting connected posts is rather hard to read:
Much more familiar would be: