Strip Extra ImageScaler Attribute from Plugin-Generated Code

October 2, 2009

in WordPress

I am using the ImageScaler plugin for WordPress on a project, and I like what it does, but it adds a non-standards-compliant attribute to images, such as:

<img class="" src="http://www.example.com/imagescaler/generated-image.jpg" alt="Example" width="258" height="234" imagescaler="http://www.example.com/imagescaler/original-image.jpg" />

To strip imagescaler’s imagescaler attribute, add the following into your functions.php file:

add_filter('the_content', 'strip_imagescaler');
function strip_imagescaler($content) {
	$content = preg_replace('/imagescaler="(.*?)".?/s','', $content);
	return $content;
}
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Twitter

Related posts:

  1. Simple Taxonomies Formatting — Improve the Plugin’s Code Output
  2. Cars and Code – Not all that different
  3. Kick SEO Ass with SEO WordSpinner Plugin for WordPress
  4. How to tell if your WordPress Plugin or Widget is Activated in WordPress
  5. Admin Drop Down Menu plugin does not break WordPress 2.5 Image Uploader [updated]

Leave a Comment

Previous post:

Next post: