jaredatch/Custom-Metaboxes-and-Fields-for-WordPress — Issue #93: Remove P tag from around images in metabox editor?
Author: jezthomp
Created: 2012-01-18 16:28:35+00:00
State: open

Currently a function can achieve this for the main editor..

function filter_ptags_on_images($content){
return preg_replace('/

\s*()?\s*()\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}

add_filter('the_content', 'filter_ptags_on_images');

Any way of having a function for the newly created editors in the custom metabox? As when an image is placed in these, the pesky p tag returns around images...