在使用主题检查插件检查我的主题时,我发现下面列出了一些错误,以及显示这些错误(必需:)的代码行。
REQUIRED: plugin-activation.php. Themes should use add_theme_page() for adding admin pages. Line 335: add_submenu_page(
add_submenu_page(
$this->parent_menu_slug, // Parent menu slug
$this->strings[\'page_title\'], // Page title
$this->strings[\'menu_title\'], // Menu title
\'edit_theme_options\', // Capability
$this->menu, // Menu slug
array( &$this, \'install_plugins_page\' ) // Callback
);
REQUIRED: panel_functions.php. Themes should use add_theme_page() for adding admin pages. Line 143: add_menu_page(theme_name.\' Settings\', theme_name ,\'install_themes\', \'panel\' updated the list.
$icon = get_template_directory_uri().\'/innovative_panel/images/ipanel-settings.png\';
add_menu_page(theme_name.\' Settings\', theme_name ,\'install_themes\', \'panel\' , \'panel_options\', $icon );
$theme_page = add_submenu_page(\'panel\',\'Settings\', theme_name.\' Settings\',\'install_themes\', \'panel\' , \'panel_options\');
add_submenu_page(\'panel\',theme_name.\' Documentation\', \'Documentation\',\'install_themes\', \'docs\' , \'redirect_docs\');
add_submenu_page(\'panel\',\'Support\', \'Support\',\'install_themes\', \'support\' , \'innovative_get_support\');
还请告诉我,我的主题是否会被这些错误的审阅者接受?
提前感谢!
最合适的回答,由SO网友:hornj 整理而成
主题需要使用Wordpress主题目录中的add\\u theme\\u page()。您需要:
add_theme_page(
$this->strings[\'page_title\'], // Page title
$this->strings[\'menu_title\'], // Menu title
\'edit_theme_options\', // Capability
$this->menu, // Menu slug
array( &$this, \'install_plugins_page\' ) // Callback
);
s
add_theme_page(theme_name.\' Settings\', theme_name ,\'install_themes\', \'panel\' , \'panel_options\');
$theme_page = add_theme_page(\'Settings\', theme_name.\' Settings\',\'install_themes\', \'panel\' , \'panel_options\');
add_theme_page(theme_name.\' Documentation\', \'Documentation\',\'install_themes\', \'docs\' , \'redirect_docs\');
add_theme_page(\'Support\', \'Support\',\'install_themes\', \'support\' , \'innovative_get_support\');