Posted By

maxxscho on 10/12/11


Tagged

wordpress images


Versions (?)

Wordpress Image Remove Attributes


 / Published in: PHP
 

Remove the Attributes in - Tags in the Post/Page Content

  1. add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 );
  2. add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 );
  3.  
  4. function remove_thumbnail_dimensions( $html ) {
  5. $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
  6. return $html;
  7. }

Report this snippet  

You need to login to post a comment.