Home Forums Add-ons Options Page Get_fields() not working on only local-json


Get_fields() not working on only local-json

  • I’m using a WP network based on one theme for multiple websites. Through the acf-json folder function I’m able to sync the ACF settings throughout the sites.

    The problem I’m now facing is that new sites first manually need to sync in order to run get_fields(‘options’). I think this function is based on the DB input, rather than the JSON files.

    Is there a way to to get_fields() based on the JSON instead of the DB? Or if the fields doesn’t exist in the DB, look to the JSON file?

  • Hi @cronius,

    To be clear, you mean that you cant use any fields in an options page before syncing manually?

  • UPDATE: Looks like I have a GIT merge conflict message in my JSON file, that was preventing it from being loaded at runtime.

    I’m seeing this same behavior on a “Page Link” field type, when I rely on the local JSON to load the field sets at runtime.

    When the field groups are loaded from JSON at runtime, I get the ID of the page when using get_field. When I’m using a “synced” fieldset, I get the URL of the linked page.

    It seems the issue is related to return format differing depending on how the field group is loaded.

    Seems to be an issue with other field types too:

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Get_fields() not working on only local-json’ is closed to new replies.