问题描述
我正在尝试将字段添加到Woocommerce产品供应商插件的“编辑供应商”页面。
对于我使用的产品:
add_action('woocommerce_product_options_general_product_data','woocommerce_product_custom_fields');
function woocommerce_product_custom_fields()
{
global $product_object;
echo '<div class=" product_custom_field ">';
// Custom Product Text Field
woocommerce_wp_text_input(array(
'id' => 'data','label' => __('data:','woocommerce'),'placeholder' => '','desc_tip' => 'true'
));
}
要添加自定义woocommerce_wp_text_input,然后:
$product->update_Meta_data("customField",sanitize_text_field($_POST['data']));
进行设置。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)