Well, I’m looking for source code of these two small containers (PHP backend, HTML frontend & JS used to attach the image):
I want to build a theme option based on Featured Image code, but I’m not able to find it. I’m pretty sure it is somewhere in wp-admin directory, but I’ve spent loong time there and found nothing.
Any clues?
Markup of that metabox is generated by
_wp_post_thumbnail_html()
function, contained inwp-admin/includes/post.php
.Some handy links for you:
Those are useful if you’re wanting to display or act differently in the theme, based on the featured image.
Here is a complete example to have the Featured image meta box display and work outside the
wp-admin/post.php
page context (since WordPress 4.6, seewp-admin/includes/post.php
), which is one of the possible reason why you might want to know where is the code stored: