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
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.