Skip Navigation

[Resolved] Toolset Types Post Relationships API

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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 1 year, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2467317

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

#2467505

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.