How to remove WordPress srcset tag for old posts images prior WP 4.4

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 1 MiB.

Expand view Topic review: How to remove WordPress srcset tag for old posts images prior WP 4.4

How to remove WordPress srcset tag for old posts images prior WP 4.4

by axew3 » Wed Jun 29, 2016 8:25 pm

To solve all problems reported here:
https://make.wordpress.org/core/2015/11 ... press-4-4/

Code: Select all

function srcset_remove( $sources ) {
	  return false; // this will nullify srcset added to img tag on images since wp 4.4 
	  // todo: return correct value for the wp_calculate_image_srcset filter
}

add_filter( 'wp_calculate_image_srcset', 'srcset_remove' );
You may would like to run this, only for old posts with date prior your WP update to 4.4 or >

Top