Remove Image Width and Height
-
Hi, after I updated wordpress to 5.5 the following code doesn’t work anymore.
function remove_width_attribute($html) { $html = preg_replace('/(width|height)="\d*"\s/', "", $html); return $html; } add_filter('post_thumbnail_html', 'remove_width_attribute', 10); add_filter('image_send_to_editor', 'remove_width_attribute', 10);Actually in the Editor I don’t see width and height …. but when I open the blog post now, the image / figure contains width and height and that is not what I am expecting, can someone help me out?
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Remove Image Width and Height’ is closed to new replies.