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!
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.
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.
Ok thanks, and is there any way to attach/append the post objects array to an empty newly created wpquery object?
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/