Forked from jeremyboggs/wp-remove-inline-image-sizes.php
Created
November 29, 2010 15:24
-
-
Save waynegraham/720074 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Removes inline width and height attributes for images. Thanks to | |
* @boonebgorges for help with this! | |
**/ | |
function clioweb_remove_inline_sizes($html) { | |
$pattern = '/(\sheight|\swidth)="(.*?)"/'; | |
$html = preg_replace($pattern, '', $html); | |
return $html; | |
} | |
add_filter( 'get_image_tag', 'clioweb_remove_inline_sizes', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hot. I so need to learn regex.