Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add custom meta field to WooCommerce order email.
add_filter('woocommerce_email_order_meta_fields', 'dog_breed_checkout_field_order_meta_fields', 10, 3 );
function dog_breed_checkout_field_order_meta_fields( $fields, $sent_to_admin, $order ) {
$fields['dog_breed_name'] = array(
'label' => __( 'Dog Breed' ),
'value' => get_post_meta( $order->id, 'dog_breed_name', true ),
return $fields;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment