Hi Héctor, thank you so much for replying that fast! Your solution looks good, before I try it what do you think of that instead ? (I’m using the shortcode in a tag description that’s why I’m using term_description in add_filter below), but so far no luck, it doesn’t see to work … Am I getting close ?
function shortcode_empty_paragraph_fix( $content ) {
// define your shortcodes to filter, '' filters all shortcodes
$shortcodes = array('wpp');
foreach ( $shortcodes as $shortcode ) {
$array = array (
'<p>[' . $shortcode => '[' .$shortcode,
'<p>[/' . $shortcode => '[/' .$shortcode,
$shortcode . ']</p>' => $shortcode . ']',
$shortcode . ']<br />' => $shortcode . ']'
);
$content = strtr( $content, $array );
}
return $content;
}
add_filter( 'term_description', 'shortcode_empty_paragraph_fix' );