Support

Account

Home Forums Backend Issues (wp-admin) Update ACF Field on daily basis Reply To: Update ACF Field on daily basis

  • Actually, this won’t work. Reason being, you need access to the order to get the date for comparison!

    So you have options:
    1) When you run the date difference checker the first time (as per your other post), I think I’d be inclined to have another custom field which stores the value from:
    $date_created = $order->get_date_created();

    OR
    2) When you run the date difference code for the first time (as per your other post), you store if post ID of the order. That way, you can query the order post ID to get the order completed date.

    In my mind, option 1 is far easier and easier to implement:
    1) Just an another update_meta line to your other code
    2) Add a get_field on the code I posted above to get the order completed date

    As I say, my only concern is how many posts you may need to return each day, may timeout or become slow