mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Plugin page hooks. Props: morganiq. http://mosquito.wordpress.org/view.php?id=785 http://mosquito.wordpress.org/view.php?id=797
git-svn-id: https://develop.svn.wordpress.org/trunk@2234 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -35,14 +35,19 @@ foreach ($submenu["$parent_file"] as $item) :
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( (substr($self, -10) == substr($item[2], -10)) || (isset($plugin_page) && $plugin_page == $item[2]) ) $class = ' class="current"';
|
||||
if ( (isset($plugin_page) && $plugin_page == $item[2]) || (!isset($plugin_page) && substr($self, -10) == substr($item[2], -10)) ) $class = ' class="current"';
|
||||
else if (isset($submenu_file) && $submenu_file == substr($item[2], -10)) $class = ' class="current"';
|
||||
else $class = '';
|
||||
|
||||
if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}"))
|
||||
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
|
||||
else
|
||||
if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}")) {
|
||||
$page_hook = get_plugin_page_hook($item[2], $parent_file);
|
||||
if ( $page_hook )
|
||||
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>";
|
||||
else
|
||||
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
|
||||
} else {
|
||||
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
|
||||
}
|
||||
endforeach;
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user