Home Forums General Issues Conditional nested relations? Reply To: Conditional nested relations?

  • There really isn’t a way to make the field keys dynamic.

    You need to have the exact fields that you want to act on. Even when using the ACF JS API you must provide a field key to get a field.

    You could potentially localize the script with the field keys needed, but that just transfers the hard coding to the server PHP rather than the JS code.

    You could potentially create a site option to define the fields that will be used, but that would make even more work.

    If this was something that I would be using many times I would build a plugin and define the fields with PHP so that the field keys would never change.