How can I insert pictures into a post without any hard coded dimensions (e.g. <img src="" alt="" />
instead of <img src="" alt="" width="" height="" />
)? I don’t want my users to switch to the HTML tab and remove the parameters by themselves, so I was wondering if there is any filter I can use to achieve this?
Note: I’m already inserting them in “Full size”.
I don’t know if this is the best way to do this, but it works for me.
In the functions.php of the theme you are using, put this:
It uses regular expresions to change the output that is inserted in the editor.
Looks like you can do it with image captions, but not images at present:
From the wp-hackers mailing list:
I found a solution in the meantime:
wp_get_attachment_image_src()
to get thesrc
for the images. I think it ends up by being the easiest solution and it requires no filters.