Is it possible to force user to set featured image on some types of posts. For example I’ve got custom post type mm_photo
and I want to show some error message or somehow block user from publishing or updating post when there is no featured image set.
Leave a Reply
You must be logged in to post a comment.
Fairly simple using jQuery and global
$typenow
ex:Try the answer here: https://stackoverflow.com/a/13575967
To repeat the code from that answer:
This will not publish the post without the featured image.
This will notify admin Feature image is required.
f you would like to require that all posts have a featured image before they can be published add this snippet to the functions.php of your wordpress theme. When you try and publish a post without a featured image you get an admin message âYou must select Featured Image. Your Post is saved but it can not be published.â