[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:04:06 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 domainsupport):

 Replying to [comment:13 jim5471]:
 > If you return inline script in this way do you get problems ?
 > {{{#!php
 > <?php
 > add_shortcode( 'xxx', function(){
 >         return "<!-- wp:html --><script><!-- code here /--></script><!--
 /wp:html -->";
 >         });
 > }}}

 I didn't wait to see if inline script was affected although I have no
 doubt that it is. I started trying to overcome the issue by putting all
 returned HTML on a single line but then realised that this wasn't possible
 for <textarea> input fields that have paragraphs of text within them.

 I notice you are getting your example `xxx` shortcode to output an
 `wp:html` formatted block ... are you saying that this would be ignored by
 the content filters and could be a possible work-around?

 If this is what you meant in your original comment then I apologise as I
 didn't realise.

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


More information about the wp-trac mailing list