While attempting to build a metadates block template part to display the Published and Last updated dates in a grid layout
I noticed some styling problems and determined that in some instances the shortcode_unautop() call in template-part.php was responsible. Its continued use in Gutenberg was questioned in #26809.
I wrote a post to demonstrate the problem. The fix is simple. Remove the call to shortcode_unautop().
Step-by-step reproduction instructions
See the video.
Expected behaviour
<p> tags from paragraph blocks should not be removed programmatically by shortcode_unautop().
Actual behaviour
When a template part is used from a custom template some <p> tags are removed programmatically by shortcode_unautop().
Screenshots or screen recording (optional)
Code snippet (optional)
Commenting out the call to shortcode_unautop() resolves the issue.
Description
While attempting to build a
metadates
block template part to display the Published and Last updated dates in a grid layout I noticed some styling problems and determined that in some instances theshortcode_unautop()
call intemplate-part.php
was responsible. Its continued use in Gutenberg was questioned in #26809.I wrote a post to demonstrate the problem. The fix is simple. Remove the call to
shortcode_unautop()
.Step-by-step reproduction instructions
See the video.
Expected behaviour
<p>
tags from paragraph blocks should not be removed programmatically byshortcode_unautop()
.Actual behaviour
When a template part is used from a custom template some
<p>
tags are removed programmatically byshortcode_unautop()
.Screenshots or screen recording (optional)
Code snippet (optional)
Commenting out the call to shortcode_unautop() resolves the issue.
WordPress information
Device information