Last active
January 17, 2019 06:44
-
-
Save diegoulloao/1e04315ca9c82e3bf26a5057e348d5c7 to your computer and use it in GitHub Desktop.
Agrega filtro que elimina saltos de línea y párrafos en blancos entre shortcodes en wordpress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Elimina saltos de líneas y párrafos vacíos entre shortcodes. | |
function wp_fix_shortcodes( $content ){ | |
$array = array ( | |
'<p>[' => '[', | |
']</p>' => ']', | |
']<br />' => ']' | |
); | |
$content = strtr( $content, $array ); | |
return $content; | |
} | |
// Agrega filtro que elimina saltos de línea y párrafos en blancos entre shortcodes. | |
add_filter( 'the_content', 'wp_fix_shortcodes' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fix wordpress shortcodes.
(Agregar a functions.php)