[wp-trac] [WordPress Trac] #57351: Escaped Shortcodes don't work in Block themes

WordPress Trac noreply at wordpress.org
Sun Dec 18 19:54:22 UTC 2022


#57351: Escaped Shortcodes don't work in Block themes
--------------------------+--------------------
 Reporter:  TobiasBg      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  6.2
Component:  Themes        |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+--------------------
 The WordPress Shortcode API supports escaping of Shortcodes, by wrapping
 them in extra square brackets, like `[[shortcodetag]]`, so that the
 Shortcode is printed as text instead of being evaluated.

 This is not working in Block themes, it appears.

 To reproduce this:
 - Set up a normal WordPress site, e.g. using trunk.
 - Choose a block theme, like Twenty Twenty-Three.
 - Add a simple test plugin that adds a Shortcode, like
 {{{#!php
 <?php
 /*
 Plugin Name: Shortcode Test
 Description: Shortcode Test
 Version: 1.0
 */

 add_shortcode( 'test', 'shortcode_test' );
 function shortcode_test( $atts, $content ) {
     return 'Just a test';
 }
 }}}
 - Add a new post or page, with this test content:
 {{{
 This is an escaped Shortcode: [[test]] .

 Here, it's evaluated: [test] .
 }}}
 - Note how after saving, when viewing the page, the escaped Shortcode is
 also evaluated.
 - Repeat this with classic theme, like Twenty Twenty-One.
 - Note how the escaped Shortcode is properly shown as text.

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


More information about the wp-trac mailing list