<?php/** * Filters the content to remove any extra paragraph or break tags * caused by shortcodes. * * @since 1.0.0 * * @param string $content String of HTML content. * @return string $content Amended string of HTML content. */functionshortcode_empty_paragraph_fix($content){$array=array('<p>['=>'[',']</p>'=>']',']<br />'=>']');returnstrtr($content,$array);}add_filter('the_content','shortcode_empty_paragraph_fix');
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.