Options Framework的安装我就不说了,安装后在外观下显示。
而我们为了方便自己或用户操作,可能要改到一级菜单,这时候就需要add_menu_page函数来实现。
打开:class-options-framework.php
!路径位于此框架includes目录下
找到:add_custom_options_page
函数
可以看到原函数使用了add_theme_page
所以默认在外观下
/**
* Add a subpage called "Theme Options" to the appearance menu.
*
* @since 1.7.0
*/
function add_custom_options_page() {
$menu = $this->menu_settings();
// If you want a top level menu, see this Gist:
// https://gist.github.com/devinsays/884d6abe92857a329d99
// Code removed because it conflicts with .org theme check.
$this->options_screen = add_theme_page(
$menu['page_title'],
$menu['menu_title'],
$menu['capability'],
$menu['menu_slug'],
array( $this, 'options_page' )
);
}
将add_theme_page
改为add_menu_page