--- special_menu_items/special_menu_items.module	2010-02-21 09:30:33.000000000 -0300
+++ /Users/lourenzo/Sites/aunica/sites/all/modules/special_menu_items/special_menu_items.module	2011-06-02 15:23:56.000000000 -0300
@@ -87,8 +87,10 @@
  * This function will render link if it is "nolink" or "separator". Otherwise it will call originally 
  * overwriten menu_item_link function. 
  */
-function special_menu_itemsoverwrite_menu_item_link($link) {   
-  $theme_overwrite=variable_get('oldtheme_menu_item_link',null);
+function special_menu_itemsoverwrite_menu_item_link($link) {
+  global $theme_key;
+  $theme_overwrite=variable_get('oldtheme_menu_item_link', array());
+  $theme_overwrite=$theme_overwrite[$theme_key];
   
   if (empty($link['localized_options'])) {
     $link['localized_options'] = array();
@@ -157,9 +159,11 @@
  * We replace theme_menu_item_link with our own function.
  */
 function special_menu_items_theme_registry_alter(&$theme_registry) {
+  global $theme_key;
   
   // Save previous value from registry in case another theme overwrites menu_item_link
-  $theme_overwrite = $theme_registry['menu_item_link']['function']; 
+  $theme_overwrite = variable_get('oldtheme_menu_item_link', array());
+  $theme_overwrite[$theme_key] = $theme_registry['menu_item_link']['function'];
   
   //Store the value
   variable_set('oldtheme_menu_item_link', $theme_overwrite);
