Post 2 post integrate with plugin
Hi there, I install your plugin via composer and in my plugin base file I add this line:
require_once 'vendor/autoload.php';
next I register custom post types (instructors and classes) and connection between custom post types:
function my_connection_types() {
$settings = array(
'name' => 'instructor_2_classes',
'from' => 'instructors',
'to' => 'classes',
'admin_box' => array(
'show' => 'any',
'context' => 'side'
),
);
p2p_register_connection_type( $settings );
}
add_action( 'p2p_init', 'my_connection_types' );
but this doesn't work. When I go to phpMyAdmin I don't see any new tables. So I try to install p2p plugin via wordpress plugin page and when I activate p2p I got this fatal error:
Fatal error: Cannot redeclare scb_init() (previously declared in F:\wamp\www\igniter\wp-content\plugins\posts-to-posts\scb\load.php:89) in F:\wamp\www\igniter\wp-content\plugins\schedule\vendor\scribu\scb-framework\load-composer.php on line 12
Regards.
You should try integrating the P2P library, not the whole plugin.
Unfortunately, simply doing require 'vendor/autoload.php'; is not going to work reliably, unless you have your whole site managed using Composer or you do the same gymnastics for loading scbFramework that the P2P plugin does.
Hi there, thanks for your replay that was what I need. Regards