wp_make_content_images_responsive

函数


wp_make_content_images_responsive ( $content )
参数
  • (string)
    $content
    The raw post content to be filtered.
    Required:
返回值
  • (string) Converted content with ‘srcset’ and ‘sizes’ attributes added to images.
相关
  • wp_image_add_srcset_and_sizes()
定义位置
  • wp-includes/deprecated.php
    , line 3995
引入
4.4.0
弃用
5.5.0

过滤文章内容中的’img’元素,添加’srcset’和’size’属性。

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