样式化在WooCommerce后端中添加的自定义字段 [英] Styling custom fields added in the backend in WooCommerce
本文介绍了样式化在WooCommerce后端中添加的自定义字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我添加了一个自定义字段,并且希望标签文本从新行开始。目前,它在价格字段之间开始。
I've added a custom field, and I want the label text to start on a new line. At the moment it starts between to price fields.
我可以设置样式吗?还是不能更改优先级以将其移至另一行?
Can I style it? or cant I change the priority to move it to another line?
我是使用: WooCommerce:从产品变化中获取自定义字段,并将其显示为变化价格的后缀
推荐答案
您可以添加包装类'wrapper_class'=> 'form-row-full',
对于 wrapper_class
还有其他可能性:
-
按行优先-宽度的50%,向左
-
form-row-last
-宽度的50%,对 -
form-row-full
-宽度的100%,完整
form-row-first
- 50% of the width, leftform-row-last
- 50% of the width, rightform-row-full
- 100% of the width, full
// 1. Add custom field input @ Product Data > Variations > Single Variation
add_action( 'woocommerce_variation_options_pricing', 'Add_bulk_price_to_variations', 10, 3 );
function Add_bulk_price_to_variations( $loop, $variation_data, $variation ) {
woocommerce_wp_text_input( array(
'id' => 'bulk_price[' . $loop . ']',
'desc_tip' => 'true',
'description' => __( 'Enter the Bulk price here.', 'woocommerce' ),
'label' => __( 'Custom Field', 'woocommerce' ),
'wrapper_class' => 'form-row-full',
'value' => get_post_meta( $variation->ID, 'bulk_price', true )
));
}
这篇关于样式化在WooCommerce后端中添加的自定义字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文