0

When you upload image you have smth like this

<a href="http://vitya/wp-content/uploads/2014/06/8.jpg">  
<img class="alignnone size-Small x Big wp-image-65" src="http://vitya/wp-content/uploads/2014/06/8-286x398.jpg" alt="8" width="286" height="398" />  
</a>

I need it to be surrounded with div

<div class="size-Small x Big">
<a href="http://vitya/wp-content/uploads/2014/06/8.jpg">  
    <img class="alignnone size-Small x Big wp-image-65" src="http://vitya/wp-content/uploads/2014/06/8-286x398.jpg" alt="8" width="286" height="398" />  
    </a>  
</div>

Plz help, who know how to do this

  • Hi AucT, could you provide more details on what you've tried already (and why it didn't work)? – kraftner Jul 5 '14 at 14:14
0

You can use a image_send_to_editor filter hook to achieve what you want.

<?php
    add_filter( 'image_send_to_editor', 'imagehtmlchange', 10, 8);
    function imagehtmlchange($html, $id, $caption, $title, $align, $url, $size, $alt) {
        // your banny wrote - put your code here
        return $html;
    }
?>
| improve this answer | |
  • although already did it thx. it was really hard to find it – jsHate Jul 7 '14 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.