Example usage of helper function to display a Restful P2P connection button. Uses https://github.com/JiveDig/restful-p2p/
<?php
$args = array(
'name' => 'users_to_pages', // name of the P2P connection
'from' => get_current_user_id(), // ID of the P2P 'from' object
'to' => get_the_ID(), // ID of the P2P 'to' object
'connect' => 'Connect', // Text to create a connection
'connected' => 'Connected!', // Text when a connection is already made
'loading' => 'Loading...', // Text to display while connection is being made
);
echo get_restful_p2p_link( $args );