As I was saying the other option is to use custom code. We offer the PHP API toolset_connect_posts, which you can use to bulk-connect posts ad hoc: https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts
I can provide examples of that if you'd like.
Dear Chris,
Thanks very much! I would really appreciate examples of code snippets I could use to bulk connect say 100 child posts to a parent.
Both child and parent posts share the same category if that helps.
The relationship is one parent to many child posts...
I would need to know exactly where to place the code and how I run it... for instance would it run automatically or periodically or on command.
Thanks!
Hi Christian,
I find a free plugin called Post Connector at hidden link and https://wordpress.org/plugins/post-connector/
This plugin does exactly what I am hoping Toolset Post Relationships would do except I do not know if in using it I would be losing some Key Toolset functionalities.
It allows the bulk selection of Child Posts or Parent Posts from within either post. I believe the pro version has yet more features.
I am going to ask them if they can list taxonomies on the bulk selection page so selection accuracy will be better.
Maybe Toolset can take a look at how they make Relationship bulk selection easier to do...
Thanks
This plugin does exactly what I am hoping Toolset Post Relationships would do except I do not know if in using it I would be losing some Key Toolset functionalities.
Yes, all Toolset Post Relationship functionality would be lost with this 3rd-party plugin. This includes the ability to use Views post relationship filters, and the shortcode notation for accessing parent posts. You will lose a lot of functionality if you implement a 3rd-party post relationship tool, since they connect posts using a proprietary method.
Maybe Toolset can take a look at how they make Relationship bulk selection easier to do...
I encourage you to submit this suggestion in our request page here: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
I think it's a great idea to improve bulk association of related posts. This form will put your request in front of the key decision makers.
I would really appreciate examples of code snippets I could use to bulk connect say 100 child posts to a parent.
Okay here's a code snippet. You'll need to know the parent post ID, the child post IDs, and the slug of the post relationship. You can find the slug in Toolset > Relationships. Replace your-relationship-slug with the slug of your post relationship. Replace 1234 with the numeric ID of the parent post. Replace 1, 2, 3, 4, 5 with a comma-separated list of child post IDs you wish to associate with the parent post. Then you will create a new Custom Code snippet in Toolset > Settings > Custom Code. Use the option "Run on demand", then save and close the snippet. Hover over the snippet name and click "Run now". It should create the associations automatically. Then you can modify the snippet to use a different parent ID and different child IDs and run the snippet again if necessary.
$slug = 'your-relationship-slug';
$parent = 1234;
$children = array( 1, 2, 3, 4, 5 );
// you should not edit below this line
foreach( $children as $child ) {
toolset_connect_posts( $slug, $parent, $child );
}
Dear Toolset,
I have been a Toolset customer for several years and have submitted my share of technical support questions. Mr. Christian Cox's response to my query should be held as a model for how to respond to a question.
He assessed the situation, helped research and elucidate what my requirements were, and honestly gave options that are workable! Even though Toolset cannot do exactly what I need in the way that I want at this time, he provided me with a workable solution as to how to achieve my objective!
I had to open two tickets to get this fine response and this second response consumed less time and actually solved my issue because Chris cared to think through the problem and offer a workable potential solution.
I am appreciative for support agents like Christian who do more than just provide links to documents that may or may not be able to help but actually take the extra time to try and help us solve our problems.
We, as customers, are only asking because we have important problems that require timely solutions for our businesses and customers.
I was so pleased with this response that I felt if Christian can take the time to help me in such a genuine and complete way, I too have a responsibility to take the time to express my appreciation and gratitude.
My Issue is resolved and I will be submitting a new feature request for Toolset as well.
Thank you Christian.
My issue is resolved now. Thank you!