Tell us what you are trying to do?
I am using Toolset Types v 3.4.16 with a custom plugin I am developing and am utilizing the Post Relationships API functions, toolset_get_related_post() and toolset_connect_posts(). These were working fine, but now I am getting "Fatal error: Uncaught Error: Call to undefined function" whenever I use these functions in my code.
Is there any documentation that you are following?
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/
Is there a similar example that we can see?
What is the link to your site?
hidden link
Hi,
Thank you for contacting us and I'd be happy to assist.
The error "Call to undefined function" suggests that your code is calling the Toolset functions too early or before the plugin's functions have been loaded.
To avoid this, you'll need to make sure to delay this execution by wrapping the code in the appropriate hook function and playing around with the 'priority' too:
https://developer.wordpress.org/reference/functions/add_action/
https://codex.wordpress.org/Plugin_API/Action_Reference
In case, you still face some difficulty, you're welcome to share some context and details about exactly how you're calling these functions in your code.
regards,
Waqar