Problem: I would like to create a playlist feature so Users can add a video to an existing playlist or create a new playlist and automatically add the video to that playlist.
Solution:
There's no JavaScript API for Forms, so the best approach in this case is to use one Form and some custom code with the cred_save_data API. In the cred_save_data callback function, create a new playlist post programmatically using the wp_insert_post function. Then use the post relationships API toolset_connect_posts to connect the new playlist and new post.
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://developer.wordpress.org/reference/functions/wp_insert_post/
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 2 voices.
Last updated by 5 years, 11 months ago.
Assisted by: Christian Cox.