I am building a site where users will submit frontend forms and selected users will also have the capability to create and edit custom posts through the backend. Some of them will have no WordPress experience and they might not be interested in learning too much about WP and its terminology. So, I want to make things as simple as possible for them.
I would like one custom field to be saved automatically as the featured image of the CPT. If it is together with other fields, it will be better than the featured image box in the sidebar.
In the Builder I set the field ID to "_thumbnail_id". I tried several types of image/file fields, but the result was always the same: in the post edit screen the existing featured image disappeared and the field with the ID "_thumbnail_id" didn't even appear. I revealed native WordPress custom fields, but that field wasn't there either. The featured image was really deleted from the post.
What am I missing? How can I automatically convert a file/image field to a featured image? Both in the post edit screen and in submissions. Which type of field is best-suited for it?
At first, you should use the field single_image to set the featured image for the post.
- in the backend, you should disable the standard featured image box of the post type. If the post type is managed by Meta Box, you can go to Meta Box > Post Types > Edit the CPT > Supports tab > Disable option "Thumbnail".
- in the frontend, it works as it should.