在woocommerce的最新更新之前,我有这个自定义代码,但在更新之后,选项字段中的HTML标记现在显示在live站点上。要清楚的是,标签现在显示出来了,而在它添加换行符之前,它应该这样做。
add_action( \'woocommerce_after_order_notes\', \'checkout_outofstockoption\' );
function checkout_outofstockoption( $checkout ) {
echo \'<div id="my_custom_checkout_field"><h3>\' . __(\'Option if product is not available\') . \'</h3>\';
woocommerce_form_field( \'outofstockoption\', array(
\'type\' => \'radio\',
\'class\' => array(\'my-field-class form-row-wide\'),
\'label\' => __(\'We try our best to ensure accurate stock levels. However, in the event that your product is out of stock, please let us know how you would like us to proceed:<br />\'),
\'options\' => array(\'Substitute\'=>\' Substitute with a similar item of equal or greater value (if no suitable substitute is available a credit will be issued)<br />\',\'Credit\'=>\' Receive store credit<br />\'),
\'required\' => true
), $checkout->get_value( \'outofstockoption\' ));
echo \'</div>\';
}
在新的更新中有什么不同之处吗?
提前感谢您的帮助