mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://stackoverflow.com/questions/77667230/display-customer-orders-count-grouped-by-status-in-admin-orders-list/77667878
13 lines
440 B
Text
13 lines
440 B
Text
add_filter( 'manage_edit-shop_order_columns', 'add_customer_orders_count_column' );
|
|
function add_customer_orders_count_column( $columns ) {
|
|
$new_columns = array();
|
|
|
|
foreach ( $columns as $column_key => $column_label ) {
|
|
if ( 'order_total' === $column_key ) {
|
|
$new_columns['order_count'] = __('Count', 'woocommerce');
|
|
}
|
|
|
|
$new_columns[$column_key] = $column_label;
|
|
}
|
|
return $new_columns;
|
|
}
|