在插件类之前首先加载wordpress主题类

时间:2014-05-14 04:24:00

标签: wordpress plugins themes

我在Wordpress主题中有Chico课程。 我在functions.php

中调用它
if(!function_exists('chico_settings')):
function chico_settings() {
    $chico_settings = &Chico::getInstance('Menu_Chico');
}
endif;
add_action('init', 'chico_settings');

我们打算制作一个也想使用Chico类的新插件。 但是当我在插件中调用它时,它会说:

Fatal error:  Cannot redeclare class Chico in /var/www/chics/wp-content/themes/chico/app/chico.php on line 4

有没有办法在插件之前先加载主题?

0 个答案:

没有答案
相关问题