We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Sometimes, you need to check if two specific posts (or users) are connected. Here's how you can do that:
<?php $p2p_id = p2p_type( 'YOUR_CONNECTION_TYPE' )->get_p2p_id( $post_a, $post_b ); if ( $p2p_id ) { // connection exists $connection_field = p2p_get_meta( $p2p_id, 'YOUR_FIELD_KEY', true ); var_dump( $connection_field ); } else { // connection doesn't exist }
$post_a and $post_b are post (or user) objects.
$post_a
$post_b
There was an error while loading. Please reload this page.