[wp-trac] [WordPress Trac] #20358: Filter image_hwstring()
WordPress Trac
wp-trac at lists.automattic.com
Wed Apr 4 21:26:46 UTC 2012
#20358: Filter image_hwstring()
--------------------------+-----------------------------
Reporter: wpsmith | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
Make it possible to remove width and height from media HTML output
functions by filtering image_hwstring(). This is perfect for
responsiveness.
This can be done a few different ways:
{{{
function image_hwstring($width, $height) {
$out = '';
if ($width)
$out .= 'width="'.intval($width).'" ';
if ($height)
$out .= 'height="'.intval($height).'" ';
return apply_filters( 'image_hwstring', $out );
}
}}}
This could be easily filtered by something like:
add_filter( 'image_hwstring', '__return_empty_string' );
See #20357.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20358>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list