Return to Snippet

Revision: 52079
at October 12, 2011 23:56 by maxxscho


Initial Code
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 );
add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 );

function remove_thumbnail_dimensions( $html ) {
    $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
    return $html;
}

Initial URL


Initial Description
Remove the Attributes in <img> - Tags in the Post/Page Content

Initial Title
Wordpress Image Remove Attributes

Initial Tags
wordpress, images

Initial Language
PHP