Skip to content

Instantly share code, notes, and snippets.

@filipecsweb
Last active April 10, 2019 01:46
Show Gist options
  • Save filipecsweb/44307082c2cf941da046 to your computer and use it in GitHub Desktop.
Save filipecsweb/44307082c2cf941da046 to your computer and use it in GitHub Desktop.
Add custom column to shop_order post type
<?php
/**
* Add custom column to shop_order post type
*
* @param $columns array Array of all registered columns.
*
* @return array $new_columns
*/
function add_custom_column_to_shop_order( $columns ) {
$new_columns = is_array( $columns ) ? $columns : array();
$new_columns['software_key'] = __( 'Chave' );
return $new_columns;
}
add_filter( 'manage_edit-shop_order_columns', 'add_custom_column_to_shop_order' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment