Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Get value from an input field and pass into update_meta_data as $meta_value

You can use the $posted parameter to get the right value in your function.

add_action('woocommerce_checkout_update_order_meta',function( $order_id, $posted ) {

$order = wc_get_order( $order_id );
$order->update_meta_data( 'recipient_email', $posted['recipient_email'] );
$order->save();
} , 10, 2);

Verify that $posted is an array not an object with a var_dump on $posted.
if it’s an object replace $posted['recipient_email'] with $posted->recipient_email

Hope it helps đŸ™‚

Related Posts:

  1. Set attached to state
  2. How to change ID of an attachment in wp_posts and its related tables correctly?
  3. Add multiple attributes to product from php
  4. Woocommerce email template customization [closed]
  5. How to send an automated email to the customers when product is added woocommerce
  6. Redirect to another page using contact form 7? [closed]
  7. Is it possible to send blog posts via email to subscribers?
  8. Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
  9. How can I concatenate variables to search results title? [closed]
  10. Function added to hook “new_to_publish” not executing – custom plugin
  11. Link Posts to External URL
  12. What snippet do I need to type to show my ACF field show up on my theme?
  13. Is there a way to make [Table Of Content] plugin while not using revision data?
  14. Help to Create a Simple Plugin to make a post
  15. “Enable Media Replace” plugin does not update serialized object in WPMeta
  16. WordPress eMails not working
  17. How to Save settings of custom tab product page in admin side in a database?
  18. Get post id in Post Page within Wp-admin
  19. Send Processing Order Email from custom payment plugin
  20. how to add meta for order in woocommerce
  21. Show WooCommerce products based on query parameters on redirect
  22. additional fields based on the quantity of products selected
  23. Difficult case to solve – Select + select = result(related data)
  24. How to get 1 or 2 specific posts on top of my wordpress blog?
  25. Portfolio + Blog: multisite or plugin?
  26. Serve different files depending on OS/Browser
  27. Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
  28. Accessing post’s meta data based on user’s click of a post
  29. Hook into and send mail using WP Mail SMTP type plugin from HTML static front page?
  30. How to configure two SMTP Server for wordpress
  31. Absolute Image URL in srcset is appended to the upload dir
  32. Dropdown menu on custom page with product to choose number of products per page
  33. Woocommerce plugin for minimum order and add-to-card-step
  34. Add Product Subtitle to Woocommerce Product Page
  35. Change wordpress current_time function to different timezone
  36. Only Homepage not loading properly
  37. WooCommerce shop page orderby [closed]
  38. How can you include a theme template file from within a plugin (i.e. WooCommerce’s Shop page)?
  39. Email Bounce Address
  40. woocommerce 3.2.1 not sending order notification emails
  41. View Private Published Page with URL Code (no login required)
  42. Integrating non-WooCommerce and WooCommerce Orders together [closed]
  43. Change the method of a class from child function.php
  44. With W3 Total Cache when I publish a post it does not appear in the homepage. Only if i purge all cache [closed]
  45. Override Javascript in a Plugin?
  46. WordPress Registration Email by Role
  47. WooCommerce Custom Product to checkout
  48. Woocommerce – How to populate custom select field with stored values on checkout page?
  49. Automatically add attributes to woocommerce product?
  50. Reduce Drop down Menu Width in WordPress
  51. The problem with WordPress Importer
  52. Cron job not firing
  53. Solutions to repost categories into multisite blogs?
  54. How to enable qTranslate languages tabs in custom plugin page
  55. How do I “get the next 10 posts after post_id == x”?
  56. Hiding posts – WP Hide Post not working
  57. Create digital-virtual-downloadable WooCommerce products from the frontend using Gravity Forms? [closed]
  58. submit posts by unregistered users in wordpress
  59. Calendar Solution: Handling upcoming Dates with Posts?
  60. get_post_type on post.php
  61. Is there an easy way to flag posts in the admin area?
  62. What is generating my meta og:description?
  63. finding whether request is for post, and post id
  64. Any built-in function to associate a post to category through a plugin?
  65. How to hide some section in WordPress under Post
  66. Display post lists in 2nd paragraph
  67. How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
  68. Can’t delete Draft Post [closed]
  69. Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
  70. How to enable specific plugin only based around shop manager role?
  71. What are wsm tables for?
  72. WordPress automatically removes line break
  73. Matching Chapters to a Custom posts [closed]
  74. How to display the “ratingValue” and “ratingCount” values ​generated by the KK Star Ratings plugin into my page’s recipe ld+json schema
  75. Why required field not working in Country dropdown in WooCommerce –
  76. Woocommerce API HTTP Response 401
  77. WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
  78. woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
  79. How to use WP-CLI / WC-CLI to bulk import 1000s of products (variable and simple)?
  80. Add woocommerce variation images in gallery?
  81. woocommerce payment gateway callback not firing [closed]
  82. How to modify WCMP Rest API response?
  83. Fetch Children of Grouped Products Inside WooCommerce Product Loop
  84. WordPress display breadcrumbs using Yoast plugin [closed]
  85. WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
  86. Outbound link autometic converted into linkdirect , and not opening
  87. Woocommerce dependent plugin
  88. Get sent emails without email logs
  89. How to check current user before all actions and filters?
  90. New databes tables with – WooCommerce – for developers [closed]
  91. Display by Category in Admin
  92. get current date + 90 days and checking every day
  93. Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
  94. WooCommerce: Building a page with user input which is used to query order status and external API and return a result
  95. woocommerce product countdown not showing in variable product? [closed]
  96. Change commission_status paid when withdraw_status vendor is completed
  97. I want to disable Cash on delivery based on product tag in woocommerce Checkout Page [closed]
  98. Is there a way to create custom product templates based on category on WooCommerce?
  99. Woocommerce Deposit, then random payments until product paid in full [closed]
  100. Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
Categories plugins Tags email, plugins, post-meta, posts, woocommerce-offtopic
Excerpts not showing on main page
Use content filter on the post that is password-protected

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress