Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('get_image_tag', 'add_image_frames', 10, 6);
- function add_image_frames($html, $id, $alt, $title, $align, $size) {
- list($img_src, $width, $height) = image_downsize($id, $size);
- $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
- $class = apply_filters('get_image_tag_class', $class, $id, $align, $size);
- $before = '<div class="image_frame align'.$align.' size-'.$size.'"><div style="background-image: url(\'' . esc_attr($img_src) . '\');"><span>';
- $after = '</span></div></div>';
- $html = $before . $html . $after;
- return $html;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement