diTii.com Digital News Hub

Sign up with your email address to be the first to know about latest news and more.

I agree to have my personal information transfered to MailChimp (more information)


Removing Width/Height from the Image Uploader

A lot of WordPress users have wanted to prevent WordPress 2.5.x from inserting the width and the height, when uploading the images in the new 2.5 media manager. You can do this with a simple code by adding into your theme’s functions.php file. The code in question is a WordPress filter, that’s called as image_downsize, which takes in three arguments (a boolean, an attachment ID, and a size string).

add_filter('image_downsize', 'my_image_downsize',1,3);

As a result, when the image is sent to the editor, the above filter calls the my_image_downsize function in wp-includes/media.php with the default priority and arguments, and no width or height is present.

If you’re not comfortable with coding, you can download sample functions.php or a plugin.

Share This Story, Choose Your Platform!

Get Latest News

Subscribe to Digital News Hub

Get our daily newsletter about the latest news in the industry.
First Name
Last Name
Email address
Secure and Spam free...