Currently I'm working on a project where site is driven by user articles, how it works:
- Any user goes to compose post page and writes post along with few details, has upload file option for image and then submits
- Post is uploaded in wordpress and the image attached is set as featured image
- Admin approves the post and it gets published.
Here user is not required to have an account. I am using
wp_insert_post to create a new post but not able to figure out how to add featured image via PHP.