Home › Forums › Add-ons › Options Page › get_field('xxx', 'options') not returning value anymore › Reply To: get_field('xxx', 'options') not returning value anymore
Hi @alexlat20
Are you able to help debug this issue? By making some minor tweaks to a file, we will be able to test out the cache issue:
Change 1: core/fields/_functions.php: line 126
//update cache
wp_cache_set( 'load_value/post_id=' . $post_id . '/name=' . $field['name'], $value, 'acf' );
to
//update cache
wp_cache_set( 'load_value/post_id=' . $post_id . '/name=' . $field['name'], $value, 'acf_' . get_current_blog_id() );
Change 2: core/fields/_functions.php: line 56
$cache = wp_cache_get( 'load_value/post_id=' . $post_id . '/name=' . $field['name'], 'acf', false, $found );
to
$cache = wp_cache_get( 'load_value/post_id=' . $post_id . '/name=' . $field['name'], 'acf_' . get_current_blog_id(), false, $found );
Let me know if making these 2 changes fixes the get_field problem.
Also, you can test just removing the cache check completely by commenting out line 60.
Thanks
E
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.