Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

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

1 Answer 1

up vote 0 down vote accepted

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;
    }
?>
share|improve this answer
    
although already did it thx. it was really hard to find it –  AucT Jul 7 at 15:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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