Admin hangs up in p2p_created_connection action
-
I have a many to one relationship between 2 custom post types Histories and Persons. What I need is, whenever a person is assigned to a history, getting its id to be able to store in a custom field when the post is saved
The problem: when a connection is created the waiting icon keeps spinning foreverclass Create_CCTs { private $person_id; … public function __construct() { add_action( 'p2p_created_connection', array( $this, 'handle_new_connection' ) ); ... public function handle_new_connection( $p2p_id ) { $all_connections = p2p_get_connection( $p2p_id ); foreach ( $all_connections as $connection ) { if ( 'history_to_person' == $connection->p2p_type ) { $this->person_id = $connection->p2p_to; } } } … }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Admin hangs up in p2p_created_connection action’ is closed to new replies.