Our site uses TLS and to the best of my ability I've forced TLS everywhere. I've defined FORCE_SSL_ADMIN to be true and also tried the following filter which I've borrowed from the plugin SSL Insecure Content FIxer (https://wordpress.org/plugins/ssl-insecure-content-fixer/):
function fix_ssl_attachment_url( $url ) {
if ( is_ssl() ) {
if (stripos($url, 'http://') === 0) {
$url = 'https' . substr($url, 4);
}
}
return $url;
}
add_filter( 'wp_get_attachment_url', 'fix_ssl_attachment_url', 9999 );
Despite the above, for whatever reason the Featured Image
metabox is attempting to load thumbnails via HTTP, causing it to fail to load and no preview to be displayed. Interestingly, the media library itself seems to be behaving correctly. The front end of the site has no issues. Here's a screenshot of the area I'm talking about, since I'm pretty sure I got some of the terminology wrong:
Installation of the above-mentioned plugin seems to actually solve the issue, but I can't figure out why and I'm not big on leaving plugins installed that I really shouldn't need. The site has been on HTTPS for a while and I think the issue only began recently, leading me to believe it's something I screwed up but I can't for the life of me figure out what that may have been.