Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CLEAR IMAGES ATTRIBUTES
- function image_tag_class($class, $id, $align, $size) {
- $align = 'align' . esc_attr($align);
- return $align;
- }
- add_filter('get_image_tag_class', 'image_tag_class', 0, 4);
- function image_tag($html, $id, $alt, $title) {
- return preg_replace(array(
- '/\s+width="\d+"/i',
- '/\s+height="\d+"/i',
- '/alt=""/i'
- ),
- array(
- '',
- '',
- '',
- 'alt="' . $title . '"'
- ),
- $html);
- }
- add_filter('get_image_tag', 'image_tag', 0, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement