Ok so here’s the deal from the top. I have a large amount of static pages 11,000+ on each one there is a function that is supposed to save a few random reference numbers in ACF fields which will be used to pull data from the database.
There’s a bunch more to it but it’s not particularly relevant because even the basic stuff is not working properly.
For the purpose of fixing this problem let’s say I have 2 function on the page only, which is basically the case at this point.
update_field('reference_number', 92);
$number = get_field('reference_number');
echo $number;
when I initially load one of the pages it will display correctly 92. If I immediately refresh the page the 92 goes away as if the field no longer exists, and I can never get it back. Also if I change the update_field() to enter a different number it will never change the number after that initial page load including if I check the actual entry in the postmeta table in the database.
Additionally everything is there and looks correct when I check the postmeta table in the database.
Nope doesn’t look like that’s the issue, the $post->ID stays the same the whole time. There’s very little happening on this page, like I said I’m just starting to set everything up, so all it has to do right now is find these fields from ACF and use that to display the proper data nothing else. Not to mention that specifying the post number at the end of the get_field() function also doesn’t help.