listen up

WordPress and SSL images in WPv4.4

Responsive images became the new standard in WordPress 4.4, released in December 2015. One major issue is sites that run SSL full time. Having that green secure lock in the browser bar is important. It’s good for security, required for online transactions, and adds a great deal of credibility to the site.
With WP 4.4 out of the box, you may find your site looking likeĀ it has a lot of broken images. Turns out that featured images in WP 4.4 still load as HTTP. With out the https, the users browser will block any resource that is unsecured.
So we have a small patch for this.
Using the following code in your functions file.

add_filter('wp_get_attachment_image_attributes', function($attr) {
    if (isset($attr['sizes'])) unset($attr['sizes']);
    if (isset($attr['srcset'])) unset($attr['srcset']);
    return $attr;
}, PHP_INT_MAX);
add_filter('wp_calculate_image_sizes', '__return_false', PHP_INT_MAX);
add_filter('wp_calculate_image_srcset', '__return_false', PHP_INT_MAX);
remove_filter('the_content', 'wp_make_content_images_responsive');

Okay so the code above actually disables WP 4.4 responsive images feature from running. So while yes you wont have that new 4.4 feature, a site built to be responsive will still load fine.
This should be fixed in WP 4.4.2, but we are still seeing a few sites with the issue, so for now this is the best fix to keep your WordPress site running in full SSL mode.