Problem:
1. what hook can be used to trigger a function to send child posts to trash? Apparently wp_trash_post doesn't work here?
2. Upon upgrading Types to the latest release the following fragment wouldn't work (_wpcf_belongs is not part of the meta_key anymore?):
Solution:
Q1) Toolset form plugin is also using function wp_trash_post() to trash the post, so the wordpress action hook "wp_trash_post" should work too, more help:
https://developer.wordpress.org/reference/hooks/wp_trash_post/
Fires before a post is sent to the trash.
Q2) Yes, for the new post type relationship, please try the new Typers API function toolset_get_related_posts():
Query related posts by a set of conditions.
Relevant Documentation:
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/Hong_Kong (GMT+08:00)
This topic contains 3 replies, has 2 voices.
Last updated by 6 years, 4 months ago.
Assisted by: Luo Yang.