【发布时间】:2017-03-28 12:12:31
【问题描述】:
如果 ACF 插件已停用或未安装,我想在我的主题中阻止 fatal error。
插件的主要功能是get_field()。
我在functions.php 中写了这段代码来检查:
if ( !function_exists('get_field') ) {
function get_field() {
echo '<span>plugin ACF is not installed</span>';
}
}
请告诉我这是可以接受的做法吗?
【问题讨论】:
标签: php wordpress advanced-custom-fields