Skip Navigation

[Resolved] Toolset get relationship post return wp query object

This support ticket is created 3 years, 3 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 3 voices.

Last updated by Minesh 3 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2200135

Hello, is it possible to return WP query object when using toolset_get_related_posts() API function instead of an array of IDs/post ojects? Thanks!

#2200513

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

The function toolset_get_related_posts doesn't use WP_Query, it performs a custom query, so there is no WP query object to return.

It retrieves the related posts and returns those either as an array of post IDs, or an array of post objects.

#2200529

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As Nigel already clarified that there is no option to return the WP Query object while using the toolset_get_related_posts() API function.

#2200817

Ok thanks, and is there any way to attach/append the post objects array to an empty newly created wpquery object?

#2200881

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Toolset it self does not offer such feature. It may or may not be possible using custom code but you will require to check with our certified partners:
=> https://toolset.com/contractors/