add_filter( 'manage_edit-shop_order_columns', 'dmm_add_payment_method_column' );
function dmm_add_payment_method_column( $columns ) {
$columns['payment_method'] = __( 'Metodo di pagamento', 'dmm' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'dmm_display_payment_method_column' );
function dmm_display_payment_method_column( $column ) {
global $post;
if ( 'payment_method' === $column ) {
$order = wc_get_order( $post->ID );
echo $order->get_payment_method_title();
}
}
Copia il codice nel file functions.php del tuo tema child attivo o utilizza il plugin Code Snippets