Override has_post_thumbnail function

Is there a way to alter/change core has_post_thumbnail function?

I need to check folder on server with images first before code looks for post image attachment.

I see lots of filters to change image html but they either affect single post page or loop thumbnail and with woocommerce several other places plus admin tables, etc.

I need to place the server directory check before it even hits _post_thumbnail() or get_image so it looks like has_post_thumbnail is very first check unless I’m wrong.

Please help, suggest what can be done.

Thank you

EDIT: tried putting if statement inside post-thumbnail-template.php has_post_thumbnail function but did not work.
Where can I check for image in folder early and possibly not edit WordPress core file?

Read more here:: Override has_post_thumbnail function

Leave a Reply

Your email address will not be published. Required fields are marked *