I’ve written a lightweight plugin to make it extremely easy to create Posts 2 Posts connections via the WordPress WP-API (Rest API). If you don’t know about Posts 2 Posts, it’s an extremely powerful (developer) plugin that allows you to create a ‘connection’ between 2 objects, often posts, pages, or CPT, but also users.
A typical example Posts 2 Posts (P2P) usage is a website where you have 2 custom post types, actors and movies. They exist as separate post types so they can easily be managed via the WP backend, and each post type can conveniently have its own set of custom fields associated with it. P2P allows you to ‘connect’ (one-to-many or many-to-many) an actor to the movies they were in, or vice-a-versa (optional).
Lately I’ve been using P2P for more user based connections like allowing a logged in user to ‘like’ or ‘favorite’ posts, mark a CPT as ‘completed’, or save posts/CPT’s to ‘wish lists’. When I think about the use cases for allowing connections between logged in users and a CPT, the ideas start flowing.
Using the WordPress Rest API allows the power and flexibility of P2P connections with the ease of the WP-API for creating the connections (front end, ajax = no page reload, woot!).

The Restful P2P plugin comes with a simple helper function to help you create/display a connection button.
That’s it. Everything else is handled for you. Nice and tidy.
Now is your turn. Give the Restful P2P plugin a try.
What are some use cases you have for a plugin like Restful P2P and Posts 2 Posts?




