Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Musilda/7719111c4ed7b42e758c62d25b385347 to your computer and use it in GitHub Desktop.
Save Musilda/7719111c4ed7b42e758c62d25b385347 to your computer and use it in GitHub Desktop.
<?php
add_action( 'manage_shop_order_posts_custom_column', 'musilda_show_weight_in_order_column' );
function musilda_show_weight_in_order_column( $column ) {
global $post;
if ( empty( $post->ID ) ) {
return;
}
if ( $column == 'order-weight' ) {
$weigth = get_post_meta( $post->ID, 'order-weight', true );
echo !empty( $weigth ) ? $weigth : '';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment