Hello. Thank you for contacting the Toolset support.
Well - I do not understand why you are getting this error.
If you can share access details and problem URL and share the file path where you are using the function toolset_get_related_post I would be happy to debug this issue further.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
ahh. Well, I'm really sorry, this is totally a custom code and to debug such custom code is beyond the scope of our support policy.
I see you have wrote custom plugin and there you are trying to call the function toolset_get_related_post() and it's throwing error, it will be obvious as the needed files may not be loaded.
If you need custom programming for your project, please feel free to contact our certified partners:
=> https://toolset.com/contractors/