How to check if custom functions from plugins exist? (Using Advanced Custom Fields) [on hold]


Throughout my custom theme, I have custom fields that allow the client to change all of the text on their site and I use the Advanced Custom Fields plugin for this. So I have many bits of code in WP template files like this:

<?php the_field('page_title_description'); ?>

What I have noticed on a new install though, is if ACF isn’t installed, the theme just crashes right there at that custom function call and doesn’t display anything afterwards.

What is best practice for checking that the function exists and having a fallback, especially when I call it so many times throughout the code?

, asharpdesigner 11 months 0 Answers 33 views 0

Leave an answer