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

Question

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?

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/how-to-check-if-custom-functions-from-plugins-exist-using-advanced-custom-fields-on-hold/">

How to check if custom functions from plugins exist? (Using Advanced Custom Fields) [on hold]</a>
0
, asharpdesigner 3 months 0 Answers 16 views 0

Leave an answer