JiveDig
8/27/2016 - 11:16 PM

Example usage of helper function to display a Restful P2P connection button. Uses https://github.com/JiveDig/restful-p2p/

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 );