Skip to content

Instantly share code, notes, and snippets.

@benfavre
Created April 22, 2013 18:36
Show Gist options
  • Save benfavre/5437388 to your computer and use it in GitHub Desktop.
Save benfavre/5437388 to your computer and use it in GitHub Desktop.
Cleanup Shortcode #WordPress #functions.php
<?php
// A mettre dans functions.php
add_filter('the_content', 'clean_p_shortcode');
function clean_p_shortcode($content){
$array = array (
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']'
);
$content = strtr($content, $array);
return $content;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment