admin管理员组

文章数量:1122846

I am using a custom page template in the "twenty twenty-three" theme. I am using a shortcode block as part of the template. This results in the shortcode not running within "the_content", as that block is being called separately. I can run this specific shortcode inside the content area and in the footer (neither of which is where I want the shortcode's output to display) and it works fine. However, when I run it as a block in the page template, paragraph elements are being inserted that break the output.

I have tried applying the shortcode_unautop() function to the shortcode's output without success, and I have tried removing and then re-applying the wp_autop() filter as described in ... but none of it works because those seem to still need to be run within hooked areas like "the_content". Can anyone point me toward a method of disabling wp_autop on a shortcode block within a block-theme page template?

本文标签: