admin管理员组

文章数量:1122846

I am facing a weird issue here and can't wrap my head around it. I am using the woocommerce_checkout_update_order_meta action to add custom data to an order. In the callback function I use update_post_meta with the order ID to add the required data. However, the data is never saved. Here's what I know so far:

  • I can log the POST data and the data I want is there.
  • the order ID is correct and exists
  • using error_log I can see the update_post_meta returns an ID, but that ID does not exist in the database
  • I am using WP 6.5.3 and WC 8.9.1
  • I see nothing is the PHP error logs

Does anyone have any input on this?

本文标签: actionsupdatepostmeta returns IDbut nothing in the database