Home Forums General Issues Prevent acf/load_field filter when using get_field


Prevent acf/load_field filter when using get_field

  • I’m not sure why ACF does this, but when I use get_field('my_field') it calls the filter acf/load_field/name=my_field.

    I’m running a pretty expensive operation on this filter and certainly do NOT want it to run when loading the field from a template page.

    How can I prevent my filter from running when the get_field function is called?

  • I think it’s quite natural that it does it since you are getting the field but I would too very much appreciate a way to sidestep the filter because if you’re calling get_field from within that hook you will end up in an infinite loop. Maybe using a parameter for the get_field_object method?

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

The topic ‘Prevent acf/load_field filter when using get_field’ is closed to new replies.