[wp-trac] [WordPress Trac] #58174: A shortcode block that evaluates to nothing, renders as a space in the HTML

WordPress Trac noreply at wordpress.org
Sat Apr 22 21:49:15 UTC 2023


#58174: A shortcode block that evaluates to nothing, renders as a space in the HTML
--------------------------+------------------------------
 Reporter:  asafm7        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by asafm7):

 My research was inaccurate. I ended up solving it with:

 {{{
 add_filter("render_block_core/shortcode", "filter_core_shortcode_block",
 100, 2);

 function filter_core_shortcode_block($block_content, $block) {
     $block_content = rtrim($block_content, "\n");

     return $block_content;
 }
 }}}

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


More information about the wp-trac mailing list