Finally i got the answer i was wrong because i tried to send the variable you can not send the variable you have to just put the name of custom field slug.
In the bellow snippet i have replaced $field
with my custom field name slug _some_field
like:- $keys['How did you learn about us?'] = '_some_field';
/**
* Add the field to order emails
**/
add_filter('woocommerce_email_order_meta_keys', 'my_woocommerce_email_order_meta_keys');
function my_woocommerce_email_order_meta_keys( $keys ) {
$keys['How did you learn about us?'] = '_some_field';
return $keys;
}
Related Posts:
- How to access custom order item meta data from a meta key in WooCommerce?
- Save Custom Fields for Variations Product
- Adding existing user custom field value to a woocommerce product [closed]
- Adding Custom Text Area to WooCommerce Product
- WooCommerce conditional required checkout fields [closed]
- Include woocommerce custom field value in front-end search result
- woocommerce product custom field
- How to get customfield value by woocommerce product ID
- Conditionally hide or show woocommerce product variation in fontend by custom field
- Woocommerce: Custom fields and email shortcodes, ec_custom_field
- Bulk remove post meta
- How to create html block to display extra information on woocommerce single product page
- Display WP-Types custom fields in post [closed]
- How to add a user custom field into Woocommerce emails?
- Modifying custom order item meta from admin order view
- How to create a dropdown select of all items in an ACF field group
- How do I add an image upload, custom field to a WooCommerce product?
- WooCommerce – Adding Custom Fields To Invoice
- Woocommerce Product Custom Select List (not variation)
- jQuery – Automatic event trigger does not **really** check my form
- How to add new field to the account address?
- How to display custom field in woocommerce email orders? [closed]
- Woocommerce Retrieving custom field value from orders
- Update custom field values on edit address page woocommerce
- Woocommerce frontend edit custom fields
- How to parse a huge list of users using a CRON function?
- Access custom meta_data in processing order email
- Is it possible to add Term Meta Fields to a WooCommerce Attribute?
- Custom user registration fields in user_register hook
- Why does my numeric meta query work only on one meta key and not the other?
- Update custom field on the fly
- (woocommerce) How to get product id form order id & then retrieve custom meta linked to product?
- How to delete WooCommerce Products than have a specific custom field?
- WooCommerce 3 get custom variation on process order [closed]
- How to save array option as text and not integer?
- Use a different catalog image than the featured image
- Check if value exists before saving
- Add Custom field under the post title [closed]
- woocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19% [closed]
- price calculation from custom field (woocommerce) [closed]
- Hiding custom fields when content is empty [closed]
- Cannot save values to custom fields for variations on Woocommerce 2.4.6
- Extract array from custom field
- i want to send email on custom post field (job_status == 2) but it is not working
- Assign class to Drop Down Selections in WooCommerce Products Custom Fields
- Insert a custom field as a second email address to a completed order in WooCommerce
- additional fields based on the quantity of products selected
- Underscores in custom fields
- Add custom field to the archive page?
- Need small coding with Custom Fields Search
- Adding Custom Field to Taxonomy Input :Panel
- Unable to get Preview of Uploaded image within a Custom Meta box
- How to store the value of a custom field dropdown select for post referencing?
- Custom bulk action for media gallery items
- Localized Date Format for Custom Field
- WooCommerce: display text instead of raw checkbox value email
- Saving custom image meta fields
- Echo values from custom field outside loop php
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- Complex WP_User_Query call fails on production server
- Query post order by post and desc not working
- How do I define post titles as images using Custom Fields?
- How to show Small Box Inside Content Area, which holds (text, images, links)?
- Sort custom field by post
- How to order posts by one custom field and filter them by another one?
- How to create a gallery custom field for WordPress post?
- List users by sum of all their posts’ custom field values
- Duplicate (or more) custom fields on many posts. Is there an easy way to clean them up?
- Enable a short code in the custom meta field
- Adding extra fields to front end signup form
- Problem uploading different files as custom fields with front end post form
- How to change order of posts in admin
- Custom product fields in wp e-Commerce plugin [closed]
- make a dropdown custom field with ‘cities’ list in it
- How can I modify my meta_query to work with prices that are stored in the database that contain dollar signs and commas?
- How to add extra field in admin comment section
- wordpress multi user question
- Custom field on Quick Edit using select/dropdown – almost working right but not showing currently selected value
- Type character in name and make it invisble
- How to set up page fields with gutenberg instead of ACF
- Move the post title to another field
- ACF multi taxonomy on filterable gallery
- Unable to change checkout placeholder text
- author.php not showing content if Author has no Posts
- Custom Fields Not Working In Footer
- Permalink structure depending on custom field
- Add custom field to post with some part of url as value
- How to add custom_fields value in JSON API using create_post
- CSS conditional on custom field value
- WP Post Meta Box Field Not Showing Updated Field
- WP_Query based on multiple metadata comparisons
- same custom field for single posts
- Alter SQL query to return posts with unique custom field value, no duplicate values
- custom field output after the_content
- Post count by meta_key meta_value [closed]
- Change post status by custom fields
- Turkish Character Problem on mailing
- How to add google map to custom field
- How can i put a custom field inside this php
- Truncating characters in Advanced Custom Fields works some places but not others?