Skip Navigation

[Resolved] Set a custom image field to be set as the featured

This support ticket is created 5 years, 8 months ago. 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.

Our next available supporter will start replying to tickets in about 2.38 hours from now. Thank you for your understanding.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 5 years, 8 months ago.

Author
Posts
#1220541

Tell us what you are trying to do? I have a custom field image that I would like to set as the Featured Image upon submitting a form.

Is there any documentation that you are following? I've looked around but none of the other support tickets show how to do this... I'm thinking some custom function upon creation of the CPT.

Is there a similar example that we can see?

What is the link to your site?

#1220695

You'll need a custom code if you want the Featured Image to be saving the Image Field value.
If you just want to display the Image Field in place of the featured image on the front end you could use Toolset's ShortCodes to display the Image field in a Content Template and apply this over the Posts Content (but your theme would need to not display the featured image)

If you want the value to be saved in the database you need custom code.

This can be applied on a Toolset Form with the cred_save_data() or on the backend when saving the Post on the WordPress native save_post()
More information about those hooks can be found here:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
https://toolset.com/documentation/programmer-reference/cred-api/

To update the feature image in the database you will need to address the Post Thumbnail for example with https://codex.wordpress.org/Function_Reference/set_post_thumbnail set_post_thumbnailI() used within either of above-elaborated hooks.