| 1 | diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php |
|---|
| 2 | index d7c6f60..1f8f06a 100644 |
|---|
| 3 | --- a/src/wp-includes/shortcodes.php |
|---|
| 4 | +++ b/src/wp-includes/shortcodes.php |
|---|
| 5 | @@ function strip_shortcodes( $content ) { |
|---|
| 6 | if ( false === strpos( $content, '[' ) ) { |
|---|
| 7 | return $content; |
|---|
| 8 | } |
|---|
| 9 | |
|---|
| 10 | + // Replace escaped shortcodes like [[tag]] with a placeholder. |
|---|
| 11 | + $content = preg_replace_callback( |
|---|
| 12 | + '/\[\[([^\[\]]+)\]\]/', |
|---|
| 13 | + function( $matches ) { |
|---|
| 14 | + return '[[' . $matches[1] . ']]'; |
|---|
| 15 | + }, |
|---|
| 16 | + $content |
|---|
| 17 | + ); |
|---|
| 18 | |
|---|
| 19 | global $shortcode_tags; |
|---|
| 20 | if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) { |
|---|
| 21 | return $content; |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | $pattern = get_shortcode_regex(); |
|---|
| 25 | |
|---|
| 26 | return preg_replace_callback( "/$pattern/", 'strip_shortcode_tag', $content ); |
|---|
| 27 | } |
|---|