Support

Account

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

Unread

[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:

    https://gist.github.com/fabrizim/974169b95cd5b6db8b10

    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)

You must be logged in to reply to this topic.