Hmm that sounds like a problem with the memcache implementation. There should no reason it would pass the old value. I’ve used CMB2 for many projects where object cache was enabled, and have not had that issue.
Have you experimented with memcached specifically? SiteGround is a pretty massive hosting platform so a memcached implementation error would be far reaching. I’m not saying that’s not the case, but the more proof or information I could provide them to help track down the problem would be helpful.
Some additional details that might be helpful:
– within function, the $_POST data has the correct new value, but the $field->value is the old value.
– Fetching the field data with get_post_meta within the function also loads the old data
– Fetching the title of the post yields the CORRECT title. So the caching bug only affects custom fields.
– The new field does get persisted to the database and does show up correctly in the dashboard after saving. It’s just this hook that has the old data. On the next change of that field to another value, the last value flows into the function again.
SiteGround would be receptive to fixing any issues with their memcached implementation if I can illustrate that the issue lies with them and not CMB2. Have you tested the cmb2_save_field hook with memcached before?