On this page
wp_make_content_images_responsive( string $content ): string
This function has been deprecated. Use wp_image_add_srcset_and_sizes() instead.
Filters ‘img’ elements in post content to add ‘srcset’ and ‘sizes’ attributes.
Description
See also
Parameters
$contentstring Required-
The raw post content to be filtered.
Return
string Converted content with 'srcset' and 'sizes' attributes added to images.
Source
File: wp-includes/deprecated.php. View all references
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 );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_filter_content_tags() wp-includes/media.php | Filters specific tags in post content and modifies their markup. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
Changelog
| Version | Description |
|---|---|
| 5.5.0 | This function has been deprecated. Use wp_image_add_srcset_and_sizes() instead. |
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_make_content_images_responsive