wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_make_content_images_responsive › WordPress Function

Since4.4.0
已弃用5.5.0
wp_make_content_images_responsive ( $content )
参数:
  • (string) $content The raw post content to be filtered.
    Required: Yes
查看:
返回:
  • (string) Converted content with 'srcset' and 'sizes' attributes added to images.
定义在:
文档:

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



源码

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 );
}