Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created August 11, 2015 22:22
Show Gist options
  • Save mikejolley/8f22c991e80124114d6b to your computer and use it in GitHub Desktop.
Save mikejolley/8f22c991e80124114d6b to your computer and use it in GitHub Desktop.
add_filter( 'woocommerce_email_order_meta_fields', 'custom_woocommerce_email_order_meta_fields', 10, 3 );
function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {
$fields['meta_key'] = array(
'label' => __( 'Label' ),
'value' => get_post_meta( $order->id, 'meta_key', true ),
);
return $fields;
}
@csalzano
Copy link

This code is wc_doing_it_wrong as of version 3.0, and should be $order->get_id() instead of $order->id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment