A WordPress-centric search engine for devs and theme authors



wp_make_content_images_responsive ›

Since4.4.0
Deprecated5.5.0
wp_make_content_images_responsive ( $content )
Parameters:
  • (string) $content The raw post content to be filtered.
    Required: Yes
See:
Returns:
  • (string) Converted content with 'srcset' and 'sizes' attributes added to images.
Defined at:
Codex:

Filters 'img' elements in post content to add 'srcset' and 'sizes' attributes.



Source

function wp_make_content_images_responsive( $content ) {
	_deprecated_function( __FUNCTION__, '5.5.0', 'wp_filter_content_tags()' );

	// This will also add the `loading` attribute to `img` tags, if enabled.
	return wp_filter_content_tags( $content );
}