1 回答
TA贡献1871条经验 获得超13个赞
add_filter('manage_edit-shop_order_columns', 'webtoffee_alter_order_columns');
function webtoffee_alter_order_columns($columns) {
$new_columns = ( is_array($columns) ) ? $columns : array();
unset($new_columns['order_number']);
$res_array = array_slice($new_columns, 0, 1, true) + array("custom_order_number" => "Order Number") + array_slice($new_columns, 1, count($new_columns)-1, true);
return $res_array;
}
add_action('manage_shop_order_posts_custom_column', 'webtoffee_alter_order_number_columns', 10, 2);
function webtoffee_alter_order_number_columns($column) {
global $post, $woocommerce, $the_order;
if ($column === 'custom_order_number') {
// do your stuff
}
}
- 1 回答
- 0 关注
- 103 浏览
添加回答
举报