Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2. // Do NOT include the opening php tag.
  3. // Place in your theme's functions.php file
  4.  
  5. /**
  6. * Add a custom field (in an order) to the emails
  7. */
  8. add_filter( 'woocommerce_email_order_meta_fields', 'custom_woocommerce_email_order_meta_fields', 10, 3 );
  9.  
  10. function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {
  11. $fields['meta_key'] = array(
  12. 'label' => __( 'Shipping Phone' ),
  13. 'value' => get_post_meta( $order->id, '_shipping_phone', true ),
  14. );
  15. return $fields;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement