Skip Navigation

[Résolu] Types 3.3.11

This support ticket is created Il y a 3 années et 10 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 3 réponses, has 3 voix.

Last updated by Waqar Il y a 3 années et 10 mois.

Assisted by: Waqar.

Auteur
Publications
#1665989

The changelog for Types 3.3.11 says:-

We’ve extended the toolset_get_related_posts() arguments by “orderby_role” which allows to specify by which role the ordering should happen (when the “order” argument is used). If the “orderby_role” argument is not present, the behavior doesn’t change and the first of the returned roles is used for ordering.

toolset_get_related_posts retrieves Custom Posts and orderby_role sorts retrieved Users by role. Posts don't have roles so I don't understand how it's possible to sort Posts by role or am I missing something??

#1666181

Hello,

The argument "orderby_role" is for roles of post type relationship, it's value is same as argument query_by_role:
- parent
- child
- intermediary

See our document:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts

#1670405

so does this mean that we can get the child posts but order by the parent??

#1673095

Waqar
Supporter

Languages: Anglais (English )

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

Hi,

Luo will be on vacation this week so I'll be following up on this ticket.

> so does this mean that we can get the child posts but order by the parent??
- Yes, your understanding is correct and this is now possible, using the "orderby_role" argument.

When this argument wasn't available the "order" argument would only work with respect to what was set in "role_to_return".

regards,
Waqar

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