Sanitize shortcode suggested
-
I’ ve found random problem with your shortcode with this plugin and “easy bootstrap shortcode” too.
for example if i try to add ul / li in “responsive tabs” there is sometimes different shortcode problem.
I think i’ve found a good solution.
source :
https://www.wpexplorer.com/clean-up-wordpress-shortcode-formatting/
function parse_shortcode_content( $content ) { // Parse nested shortcodes and add formatting. $content = trim( do_shortcode( shortcode_unautop( $content ) ) ); // Remove '' from the start of the string. if ( substr( $content, 0, 4 ) == '' ) $content = substr( $content, 4 ); // Remove '' from the end of the string. if ( substr( $content, -3, 3 ) == '' ) $content = substr( $content, 0, -3 ); // Remove any instances of ''. $content = str_replace( array( '<p></p>' ), '', $content ); $content = str_replace( array( '<p> </p>' ), '', $content ); return $content; }
then add line 109 and 153 :
$content = parse_shortcode_content( $content );
This will fixes a code that does not work.
This code work for easy bootstrap shortcode too.
I think it would be a good idea to add it to your plugin ??
Thx
- The topic ‘Sanitize shortcode suggested’ is closed to new replies.