[wp-trac] [WordPress Trac] #26649: escaped shortcodes should not be expanded during 'get_the_excerpt'
WordPress Trac
noreply at wordpress.org
Thu Apr 24 06:32:46 UTC 2025
#26649: escaped shortcodes should not be expanded during 'get_the_excerpt'
-------------------------------------------------+-------------------------
Reporter: bobbingwide | Owner: (none)
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 6.9
Component: Shortcodes | Version: 3.7.1
Severity: normal | Resolution:
Keywords: has-patch good-first-bug has-unit- | Focuses:
tests early |
-------------------------------------------------+-------------------------
Comment (by logicrays):
Hello
I've tested the fix, and it correctly prevents [[shortcode]] from
executing in get_the_excerpt(). The updated strip_shortcode_tag() handles
escaping as expected:
{{{
function strip_shortcode_tag( $m ) {
if ( $m[1] == '[' && $m[6] == ']' ) {
return '[' . substr($m[0], 2, -1);
}
return $m[1] . $m[6];
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26649#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list