我为wordpress创建了2个不同的插件。当我激活第二个时,会出现第一个菜单!
我创建第一个插件菜单的代码:
function app_create_menu()
{
$menusettings = new stdClass;
$menusettings->page_title = __("setting mysite",'creat_mysite');
$menusettings->menu_title = __("setting mysite",'creat_mysite');
$menusettings->capability = 'manage_options';
$menusettings->menu_slug = $this->app_name."_settings";
$menusettings->func = 'template_setting_mysite';
$this->_pagehooks['calctral-app-list-modules'] = $this->add_admin_menu($menusettings,'menu');
$menusettings->icon_url = '';
$menusettings->position = 400;
}
我创建第二个插件菜单的代码:
function app_create_menu(){
$menusettings = new stdClass;
$menusettings->page_title = __("Students",'Students');
$menusettings->menu_title = __("Students",'Students');
$menusettings->capability = 'manage_options';
$menusettings->menu_slug = $this->app_name."_settings";
$menusettings->func = 'template_setting_student';
$this->_pagehooks['calctral-app-list-modules'] = $this->add_admin_menu($menusettings,'menu');
$menusettings->icon_url = '';
$menusettings->position = 500;
}