嗯,有一个剧本。作者声称它删除了wpautop
形成单独的特定shorcodes。You\'ll find it here.
将此添加到functions.php
或者像下面这样的插件-
// Here I assumed that you kept the name of the PHP script file same
include "shortcode-wpautop-control.php";
然后调用下面的函数ike-
chiedolabs_shortcode_wpautop_control(
array(
\'your_short_code\'
)
);
你也可以这样称呼它-
// Create first the array of shortcodes from which you wanna remove `wpautop`
$array_of_shortcodes = [
\'1st_shortcode\',
\'2nd_shortcode\',
\'3rd_shortcode\',
];
// Then pass the array as parameter when you\'re calling the function
chiedolabs_shortcode_wpautop_control( $array_of_shortcodes );
请注意,此解决方案未经测试。在投入生产之前进行测试