add_theme_page 函数 在Wordpress后台侧边栏的【外观】下添加子菜单。
函数 add_pages_page 在内部调用的是
。函数源码:
function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = null ) {
return add_submenu_page( 'themes.php', $page_title, $menu_title, $capability, $menu_slug, $callback, $position );
}
可以看到,add_pages_page 比 add_submenu_page 就是固定了第一个参数,传入了:‘themes.php’。
使用举例:
function add_test_theme_page() {
add_theme_page( 'Theme Title Settings', 'Theme Menu Settings', 'edit_theme_options', 'test-theme-options', 'theme_option_page' );
}
add_action( 'admin_menu', 'add_test_theme_page' );
function theme_option_page() {
echo 'This is a test theme options page!';
}
-
WordPress函数:wp_list_comments 显示评论列表WordPress如何显示评论列表
-
WordPress函数:previous_comments_link 显示到上一个评论页面的链接。WordPress如何显示到上一个评论页面的链接。
-
WordPress函数:get_previous_comments_link 获取上一个评论的链接WordPress如何获取上一个评论的链接
-
WordPress函数:paginate_comments_links 文章评论的分页WordPress文章评论的分页
-
追格主题首页右侧小工具设置方法追格主题的首页右边栏小工具抛弃了WordPress传统的设置方法,全部集成到主题设置中,无需到“外观-小工具”中设置。
-
追格主题(WordPress资源下载主题,资讯主题)注册登录和找回密码的设置方法追格主题注册登录和找回密码的设置方法其实比较简单,可能有些小伙对找回密码这块比较迷茫,今天我们简单说说如何设置。
暂无评论,抢个沙发...