[wp-trac] [WordPress Trac] #49877: Content enclosed by (content enclosing) shortcode gets stripped from excerpt

WordPress Trac noreply at wordpress.org
Sun Apr 12 16:00:26 UTC 2020


#49877: Content enclosed by (content enclosing) shortcode gets stripped from
excerpt
-------------------------------------+------------------------------
 Reporter:  mmwbadmin                |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Shortcodes               |     Version:  5.4
 Severity:  normal                   |  Resolution:
 Keywords:  close reporter-feedback  |     Focuses:
-------------------------------------+------------------------------

Comment (by mmwbadmin):

 Hi,

 Step 1. On a fresh install of WP5.4 + TwentyTwenty I added this to line
 716 of functions.php:



 {{{
 function mmwb_shortcode( $atts, $content = null ) {
         return '<span style="color:red;" class="caption">' . $content .
 '</span>';
 }
 add_shortcode( 'mmwbt', 'mmwb_shortcode' );
 }}}

 Found in: https://developer.wordpress.org/apis/handbook/shortcode/


 Step 2. Create a post and use shortcode within first 55 words. I used
 ….[mmwbt]schuldig bevonden[/mmwbt] …

 [[Image(https://drive.google.com/open?id=1PrGGqh6d1Fz8djQWutqTCZ_bKXR4IXcF)]]

 Step 3. Create another post consisting of a Latest Posts Block with post
 content = excerpt

 [[Image(https://drive.google.com/open?id=1TKr7GfnI7cHFQqT7S-zRjZVrek-
 wu8wo)]]

 Already visible in the block is the missing result of the shortcode. Also
 the enclosed content is gone.

 Step 4. Go to[https://www.listbedrog.nl frontpage] to see both posts.

 Not sure what happens and whether it is caused bij plugin, theme or core

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


More information about the wp-trac mailing list