Support

Account

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