Post Type Connections through CSV
-
Hello there- I was wondering if you could potentially help me to integrate the Posts 2 Posts plugin with Supra CSV Pro. I’ve already made two custom post types: Products and Parts
What I’d like to do is set up a connection between each of the Products I’m importing and the corresponding Parts that go with each of them.
Looking at the code for the Posts 2 Posts plugin, it appears that this is the way to programatically make the connection:
// Create connection p2p_type( 'YOUR_CONNECTION_TYPE' )->connect( $from_id, $to_id, array( 'date' => current_time('mysql') ) );
(From here: https://github.com/scribu/wp-posts-to-posts/wiki/Creating-connections-programmatically)
The trouble is that I don’t actually know the $from_id and $to_id and would have to manually create each of the pages first in order to do so…
Any help on this would be greatly appreciated, as I’d love to not have to connect each of the thousands of products by hand!
Thanks so much,
Dave
- The topic ‘Post Type Connections through CSV’ is closed to new replies.