Skip to content

Instantly share code, notes, and snippets.

@JiveDig
Last active May 31, 2021 23:34
Show Gist options
  • Save JiveDig/d633f6c40e7c71a228073836745483e1 to your computer and use it in GitHub Desktop.
Save JiveDig/d633f6c40e7c71a228073836745483e1 to your computer and use it in GitHub Desktop.
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 );
@Vilenasi
Copy link

Thanks... No comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment