[wp-hackers] page_hook bugfix

Kimmo Suominen kim at tac.nyc.ny.us
Thu Feb 17 08:20:00 GMT 2005


Hi!

The global $page_hook is used in both wp-admin/admin.php and
wp-admin/menu-header.php.  The latter is called in between defining and
referencing $page_hook in the former, which makes all option pages from
plugins display the option page of the last plugin loaded.

The patch below changes the global used in wp-admin/menu-header.php to
$menu_hook.

Regards,
+ Kim
-- 
<A HREF="http://kimmo.suominen.com/">Kimmo Suominen</A>


Index: wp-admin/menu-header.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/menu-header.php,v
retrieving revision 1.6
diff -u -r1.6 menu-header.php
--- wp-admin/menu-header.php	12 Feb 2005 02:00:56 -0000	1.6
+++ wp-admin/menu-header.php	17 Feb 2005 07:57:46 -0000
@@ -40,8 +40,8 @@
 else $class = '';
 
 if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}")) {
-	$page_hook = get_plugin_page_hook($item[2], $parent_file);
-	if ( $page_hook )
+	$menu_hook = get_plugin_page_hook($item[2], $parent_file);
+	if ( $menu_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>";


More information about the hackers mailing list