[wp-trac] [WordPress Trac] #26649: escaped shortcodes should not be expanded during 'get_the_excerpt'

WordPress Trac noreply at wordpress.org
Mon Aug 4 11:39:49 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                                    |
-------------------------------------------------+-------------------------
Changes (by sachinrajcp123):

 * Attachment "26649-escaped-shortcodes-fix.patch" added.

 This patch ensures that escaped shortcodes like [[shortcode]] are not
 expanded or parsed during get_the_excerpt().  🔹 Problem: Currently, even
 escaped shortcodes may get processed and output unexpectedly in post
 excerpts. 🔹 Fix: The patch updates shortcode_unautop() to correctly
 detect and preserve escaped shortcodes by treating them as plain text. 🔹
 Benefit: This allows users to display shortcode syntax examples in content
 or documentation without triggering actual shortcode output.  This fix
 improves shortcode handling and respects user intent when using double
 square brackets.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/26649>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list