Created
August 11, 2015 22:22
-
-
Save mikejolley/8f22c991e80124114d6b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is
wc_doing_it_wrong
as of version 3.0, and should be$order->get_id()
instead of$order->id