Get the title for pluggable top level admin pages.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2005-01-30 07:34:03 +00:00
parent 0e73b09de1
commit 48d334e1c0
2 changed files with 28 additions and 24 deletions

View File

@ -701,6 +701,7 @@ function user_can_access_admin_page() {
function get_admin_page_title() {
global $title;
global $menu;
global $submenu;
global $pagenow;
global $plugin_page;
@ -709,6 +710,20 @@ function get_admin_page_title() {
return $title;
}
$parent = get_admin_page_parent();
if (empty($parent)) {
foreach ($menu as $menu_array) {
if (isset($menu_array[3])) {
if ($menu_array[2] == $pagenow) {
$title = $menu_array[3];
return $menu_array[3];
} else if (isset($plugin_page) && ($plugin_page == $menu_array[2])) {
$title = $menu_array[3];
return $menu_array[3];
}
}
}
} else {
foreach (array_keys($submenu) as $parent) {
foreach ($submenu[$parent] as $submenu_array) {
if (isset($submenu_array[3])) {
@ -722,6 +737,7 @@ function get_admin_page_title() {
}
}
}
}
return '';
}

View File

@ -1,6 +1,7 @@
<?php
require_once(dirname(__FILE__) . '/upgrade-schema.php');
require_once(ABSPATH . '/wp-admin/admin-functions.php');
require_once(ABSPATH . '/wp-admin/upgrade-schema.php');
// Functions to be called in install and upgrade scripts
function upgrade_all() {
populate_options();
@ -8,6 +9,7 @@ function upgrade_all() {
upgrade_101();
upgrade_110();
upgrade_130();
save_mod_rewrite_rules();
}
function upgrade_100() {
@ -527,20 +529,6 @@ function make_db_current_silent() {
$alterations = dbDelta($wp_queries);
}
function get_home_path() {
$home = get_settings('home');
if ( $home != '' && $home != get_settings('siteurl') ) {
$home_path = parse_url($home);
$home_path = $home_root['path'];
$root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["SCRIPT_FILENAME"]);
$home_path = $root . $home_path . "/";
} else {
$home_path = ABSPATH;
}
return $home_path;
}
function make_site_theme_from_oldschool($theme_name, $template) {
$home_path = get_home_path();
$site_dir = ABSPATH . "wp-content/themes/$template";