Support » Plugin: Posts 2 Posts » p2p_type in add_filter function

  • I’m trying to create a new connection in an add_filter function that hooks into another plugin. The basic code is as follows:

    function addConnection() {
    	global $wpdb;
    	$p2p = p2p_type("my_connection_type");
    	$p2p->connect($id1, $id2);
    add_filter("other_plugin_hook", "addConnection", 1, 2);

    However this is throwing a 500 error. When I remove the $p2p lines then the rest of the function works as expected. Any ideas on what I might be missing? Thanks.

  • The topic ‘p2p_type in add_filter function’ is closed to new replies.