Support

Account

Home Forums General Issues Fatal errors – deactivating ACF temporarily

Solved

Fatal errors – deactivating ACF temporarily

  • Hi Elliot,

    Occasionally I have to deactivate your plugin to do some bug-fixing on my sites.

    To give myself this option, I have to wrap all my ACF function calls in my template with WordPress if(function_exists) {}.

    I am fine to do this – I did however come across this post where that functionality is included in the function call itself:

    http://seanbutze.com/safely-using-advanced-custom-fields-via-wrapper-functions/

    though this does require creating a different function (__get_field();) than the core ACF get_field() or the_field() – a little inelegant.

    Just wondered if there is any way of activating or incorporating this functionality into ACF (perhaps with a more elegant functions.php solution) without these two work-arounds? I’m a bit of a PHP novice.

    Not a real issue, just a question of efficiency for me, and still being able to use ACF functions in my template files 🙂

    Ta.

  • Hi @spacewindow

    The problem is that if this solution was bundled into ACF, you would still have the same issue when ACF is deactivated!

    The code needs to lie in your functions.php file, not in ACF, so I’m not really sure how I could help.

    If you have a solution, please feel free to post it.

    THanks
    E

  • Thanks for your reply – of course – having it bundled in ACF would defeat the purpose!

    Not a major issue – if I come across a function solution I will post it here.

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

The topic ‘Fatal errors – deactivating ACF temporarily’ is closed to new replies.