Skip to content

Instantly share code, notes, and snippets.

@Musilda
Created February 17, 2019 17:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Musilda/747b7eed2f34d0c17a302134f51b909d to your computer and use it in GitHub Desktop.
Save Musilda/747b7eed2f34d0c17a302134f51b909d to your computer and use it in GitHub Desktop.
<?php
add_filter( 'manage_edit-shop_order_columns', 'toret_barcode_column', 99999 );
function barcode_column($columns) {
$new_columns = array();
foreach($columns as $key => $item){
$new_columns[$key] = $item;
if($key == 'cb'){
$new_columns['barcode'] = __( 'Barcode', 'woocommerce' );
}
}
return $new_columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'toret_barcode_column_display', 10, 2 );
function barcode_column_display($column_name, $post_id){
global $post;
if ( $column_name == 'barcode' ) {
//$field = get_post_meta( $post_id, 'barcode', true );
echo 'barcode';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment