Since WordPress 3.5 cannot change img attributes
-
Sorry about my bad english.
I wanted that every time i upload a image, wordpress automatically make this code when i insert the image:
<img src=”URLOFTHEIMAGE” width=”WIDTHOFTHEIMAGE” height=”HEIGHTOFTHEIMAGE” title=”NAMEOFTHEIMAGE” alt=”NAMEOFTHEIMAGE”>I wanted to delete the class feature that WordPress inserts in every image and to add the title and alt codes with the names of the image i uploaded.
I used this code that was functioning since the new versión of WordPress 3.5, but now it’s not working anymore.
function image_tag($html, $id, $alt, $title) { return preg_replace(array( '/alt=""/i' ), array( 'alt="' . $title . '"' ), $html); } add_filter('get_image_tag', 'image_tag', 0, 4); function image_tag_class($class, $id, $align, $size) { return ; } add_filter('get_image_tag_class', 'image_tag_class', 0, 4);Can anyone tell me how can i make it work again? Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Since WordPress 3.5 cannot change img attributes’ is closed to new replies.