Home Forums General Issues Maximum function nesting level of '256' reached


Maximum function nesting level of '256' reached

  • I’m getting a fatal with acf/load_value where I’m calling get_field within the function:

    Fatal error: Uncaught Error: Maximum function nesting level of ‘256’ reached, aborting! in <path>/wp-content/plugins/advanced-custom-fields-pro/includes/acf-utility-functions.php on line 81

    Any clues why?

  • Hi @gldixon

    This error suggests an “infinite loop”. It is most likely that your callback is triggering the filter which in turn triggers the callback, etc, etc.

    There are many solutions to avoid infinite loops. Using more specific filters, a global variable as a “is doing marker” or even unhooking the filter during callback.

    Wishing you all the best.

  • Thanks Elliot. Yes I’m pretty sure this is the case. Wasn’t aware that the get_field function trips the acf/load_value filter which seems to be the case (and therefore the cause).

    I now use a global variable (first time ever!) to avoid calling get_field and this seems to work quite nicely.


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

You must be logged in to reply to this topic.