Make WordPress Core

Ticket #26649: escaped-shortcodes-get-the-excerpt.patch

File escaped-shortcodes-get-the-excerpt.patch, 535 bytes (added by sachinrajcp123, 4 months ago)
  • src/wp-includes/shortcodes.php

    diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php
    index 2d19e21..3da5b67 100644
    a b  
    305305function strip_shortcode_tag( $m ) {
    306306        // allow [[foo]] syntax for escaping a tag
    307307        if ( $m[1] == '[' && $m[6] == ']' ) {
    308                 return '[' . substr( $m[0], 2, -1 );
     308                // return escaped opening bracket to prevent expansion during get_the_excerpt
     309                return '[' . substr( $m[0], 2, -1 );
    309310        }
    310311        return $m[1] . $m[6];
    311312}