更新时间:2023-11-30 12:24:58
你可以这样做...
function rei_woocommerce_short_description($the_excerpt) {
return wp_strip_all_tags($the_excerpt);
}
add_filter('woocommerce_short_description', 'rei_woocommerce_short_description',10, 1);
注意:
wp_strip_all_tags 将删除所有 HTML 标签,包括脚本和样式.
wp_strip_all_tags will strip all HTML tags including script and style.
如果您还想删除中断标记 <br/>
,则传递第二个参数 true.
pass second parameter true if you want to remove break tag <br/>
also.
return wp_strip_all_tags( $the_excerpt, true );