[wp-trac] [WordPress Trac] #58366: Shortcode Support Regained but Content Filters are messing with Shortcode HTML

WordPress Trac noreply at wordpress.org
Mon May 22 14:41:57 UTC 2023


#58366: Shortcode Support Regained but Content Filters are messing with Shortcode
HTML
---------------------------+------------------------------
 Reporter:  domainsupport  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Shortcodes     |     Version:  6.2.2
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by jim5471):

 OK - just found one difference between the example we have been looking at
 and the way I have coded my shortcodes.

 {{{#!php
 <?php
 function do_xxx() {
        $html = "<!-- wp:html --><script>
            var obj = { 'foo': 'bar', 'baz': 'qux'};
            var abc = 'xcxcfvgbcxbvcxbvxc';
            var json = JSON.stringify(obj);
            </script><!-- /wp:html -->";
         return $html;
     }
     add_shortcode('xxx', 'do_xxx');
 }}}
 Returns this...
 {{{#!php
 <p><script>
            var obj = { 'foo': 'bar', 'baz': 'qux'};
            var abc = 'xcxcfvgbcxbvcxbvxc';
            var json = JSON.stringify(obj);
            </script></p>
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58366#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list