2012-01-23, 23:08:24
I managed to use a function borrowed from wordpress to remove p tags on the images. It doesn't solve the editor problem as such though - e.g if an image is floated and the text sits beside it in the editor it still wraps the image and text in a paragraph. Still looking for a better solution for the editor options.
Code:
/* Remove ptags from images */
function filter_ptags_on_images($content){
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}
add_filter('content', 'filter_ptags_on_images');