Created
February 17, 2019 17:35
-
-
Save Musilda/747b7eed2f34d0c17a302134f51b909d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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