admin管理员组

文章数量:1318569

I have a shortcode which accepts basic HTML tags as shortcode attribute.

When this shortcode is used in the shortcode block i.e within <!-- wp:shortcode --> then unbalanced <p> tags are added to the shortcode attribute.

If it is used normally, then no <p> tags are added.

Are there any workarounds which can be done to avoid this issue ?

function abcd_shortcode( $atts ){
    print_r( $atts );
}
add_shortcode('abcd', 'abcd_shortcode');

Output (notice the </p> and <p> tags added for no reason in the second array)

Array
(
    [html] => <h4>Hey</h4>Outside
)

Array
(
    [html] => </p>
<h4>Hey</h4>
<p>Inside
)

本文标签: wp autopDisable wpautop on Shortcode attributes