Skip Navigation

[Resolved] Faster way to combine custom post types

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to set their post relationship programmatically.

Solution:
This can be done by using the function in the link below.
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts

This support ticket is created 4 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by heikoS 4 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1764341

Hi,

I have to combine over 2000 cities with different countries. Is there an option to choose more than one city for this in one row?

Cheers,Heiko

#1764507

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Heiko,

Thank you for getting in touch.

Can you let me know exactly what you mean by combining the cities and countries? Are you referring to binding them in their appropriate relationship ?

If so then you could look at the function below.
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts

However it will beg the question, how will we know which city belongs to which country from just the id's alone. You will need to get the id's of all the cities that would belong to a particular country, then run this through the function to connect them.

Thanks,
Shane

#1764821

My issue is resolved now. Thank you!