嘿,我想在woocommerce订单页面中做一些修改,但是我找不到正确的php文件来做这些更改,所以我可以看到,第一个屏幕截图是在更改之前

如您所见,我需要移动鼠标以查看订单说明和最后一张客户说明。
这是在改变之后

我需要文件的名称或任何其他允许我这样做的插件。
发布于 2018-06-20 02:21:11
您可能需要使用钩子manage_posts_custom_column,请参阅法典,以获得更多信息。https://codex.wordpress.org/Plugin_API/行动_参考资料/管理_帖子_自定义_列
add_action('manage_shop_order_posts_custom_column' , 'wpse_306476_order_custom_column');
function wpse_306476_order_custom_column($colname) {
global $the_order; // Get the order
if($colname == 'customer_message') // You can also use a switch here
{
$message = $the_order->get_customer_note();
// Do what you have to do here
}
elseif($colname == 'order_note') // For order_note
{
// Do what you want here
}
}这是一个部分的答案,但您将能够捕获并更改所需列中所需的内容。
https://wordpress.stackexchange.com/questions/306476
复制相似问题