【发布时间】:2014-10-16 00:41:22
【问题描述】:
我正在使用 WooCommerce 建立一个网上商店。
确定的表单格式是没有标签,只有占位符。我一直在像这样删除标签:
<?php
// WooCommerce Checkout Fields Hook
add_filter( 'woocommerce_checkout_fields' , 'custom_wc_checkout_fields' );
// Change the format of fields with type, label, placeholder, class, required, clear, label_class, options
function custom_wc_checkout_fields( $fields ) {
//BILLING
$fields['billing']['billing_first_name']['label'] = false;
return $fields;
}
?>
但由于我不想在任何地方添加标签,我想知道是否有办法一次性删除所有标签。而不是单独浏览它们。有人有想法吗?
谢谢!
编辑:
我意识到这可以通过添加一些 css(display none) 来实现,但由于这不是一个非常干净的解决方案,我想知道是否有其他方法可以实现这一点。
【问题讨论】:
标签: php wordpress forms woocommerce labels