How to prepare your sites for the new post relationships, coming in Types 2.3
Toolset Types 2.3 release (currently in Beta) introduces a completely rewritten post relationship features. We created a new Post Relationship API to make sure nothing breaks after this big release.
Who is the New API for
If you have existing sites that use custom PHP code to query related content, you should adjust it to use the new Post Relationship API.
What is the Change About
Current, official release of Types features an old, “legacy” version of post relationships. So far, you could use WP_Query and functions with the wpcf_ prefix to query these legacy post relationships.
Types 2.3 will introduce a completely rewritten, more advanced version of post relationships. When you activate this version on a site, you will be able to run an automated process that migrates all the existing, legacy post relationships to the new ones.
We created this new Post Relationship API to ensure that any of your custom PHP code that queries related content keeps working after this update. The new API works with both the legacy and the new post relationships.
What You Need To Do
Head on to our documentation page about using the new Post Relationships API and implement the necessary changes to your existing sites.
What Happens if You do not Change Your Existing Code
Your sites will continue working but the new contents you add will not show up in your custom PHP queries (new content will show perfectly fine with all Toolset elements that you build with our GUI). Besides this, there might be some additional cases where some of your custom queries involving post relationships might stop working.
While we are doing our best to ensure your current custom PHP code keeps working even if you don’t switch to the new API, we cannot promise we will be able to cover all of the possible cases.
This is why we strongly recommend updating your sites now.
As stated in our documentation, we will be adding more functions to the new Post Relationships API, to cover more use cases and scenarios.
Any Questions or Comments?
If you have any questions or concerns regarding this topic, please let us know in the comments below.