Skip to content

Instantly share code, notes, and snippets.

@JiveDig
Created August 27, 2016 23:16
Show Gist options
  • Save JiveDig/9f634c8f9f627524adfa005726d88241 to your computer and use it in GitHub Desktop.
Save JiveDig/9f634c8f9f627524adfa005726d88241 to your computer and use it in GitHub Desktop.
Display a Restful P2P connection button
<?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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment