Problem:
A CRED form is used to publish custom posts and includes a custom image field. The client would like this image to also be assigned as the featured image when the form is submitted.
Solution:
You can use the cred_save_data hook to run a snippet of code when the form submits which will set the _thumbnail_id post meta with the ID of the media post created by the custom image field. Example code is shown below: https://toolset.com/forums/topic/affect-an-image-field-as-featured-image-for-a-product/#post-513008
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/cred-api/#csd
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 |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+01:00)