Make WordPress Core


Ignore:
Timestamp:
02/25/2005 04:11:27 PM (20 years ago)
Author:
ryan
Message:

Add callback API to add_menu_page(). Fix some menu bugs. http://mosquito.wordpress.org/view.php?id=975 Reviewed by Owen.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu-header.php

    r2362 r2381  
    4040else $class = '';
    4141
    42 if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}")) {
    43     $menu_hook = get_plugin_page_hook($item[2], $parent_file);
    44     if ( $menu_hook )
    45         echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>";     
     42$menu_hook = get_plugin_page_hook($item[2], $parent_file);
     43
     44if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") || ! empty($menu_hook)) {
     45    if ( 'admin.php' == $pagenow )
     46        echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
    4647    else
    47         echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
     48        echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>";
    4849 } else {
    4950    echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
Note: See TracChangeset for help on using the changeset viewer.