Woocommerce 在CSV导出中显示自定义文件
我正在使用“Woocommerce CSV导出”插件,我刚刚在我的WC签出页面中添加了两个自定义文件,我想知道是否可以将这些文件添加到导出插件中。只需将以下代码添加到“Woocommerce导出CSV.php”中即可 和定义你的功能Woocommerce 在CSV导出中显示自定义文件,woocommerce,custom-fields,Woocommerce,Custom Fields,我正在使用“Woocommerce CSV导出”插件,我刚刚在我的WC签出页面中添加了两个自定义文件,我想知道是否可以将这些文件添加到导出插件中。只需将以下代码添加到“Woocommerce导出CSV.php”中即可 和定义你的功能 function sites_add_custom_meta() { $custom_meta_fields['columns'][] = 'IP Address'; $custom_meta_fields['data'][] = '_customer_ip
function sites_add_custom_meta() {
$custom_meta_fields['columns'][] = 'IP Address';
$custom_meta_fields['data'][] = '_customer_ip_address';
return $custom_meta_fields;
}
在这个函数中,您需要定义两件事。首先,在columns数组中,您需要定义自定义元字段的标题,然后在data数组中,您需要定义该字段的数据所在的实际元字段名称。两个数组中的顺序必须相同,才能在正确的列标题下输出正确的信息
资料来源:
function sites_add_custom_meta() {
$custom_meta_fields['columns'][] = 'IP Address';
$custom_meta_fields['data'][] = '_customer_ip_address';
return $custom_meta_fields;
}