Home Forums Bug Reports [5.0.8] Issue with local fields and wp_ajax_acf/fields/*/query


[5.0.8] Issue with local fields and wp_ajax_acf/fields/*/query

  • I have a multisite installation where subsites have child themes of the theme on the primary site. I am using the local json feature to reuse the fields within these child themes, however I have run into an issue with sub_fields of either repeater or flexible_layout fields.

    Sub fields that use ajax queries (such as post_object which calls acf/fields/post_object/query), will result in errors when running the query.

    During the request, acf_get_field will return null because acf_local()->fields does not have a key for the sub field. I wrote the following to fix the issue for my site:

    After writing that, I found the acf/prepare_fields_for_import filter which may be a better hook to use.

    Hope this helps someone else.

Viewing 1 post (of 1 total)

The topic ‘[5.0.8] Issue with local fields and wp_ajax_acf/fields/*/query’ is closed to new replies.