$item ) { $admin_is_parent = false; $class = array(); if ( $first ) { $class[] = 'wp-first-item'; $first = false; } if ( !empty($submenu[$item[2]]) ) { $class[] = 'wp-has-submenu'; $menu_setting_increment++; } if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) { if ( !empty($submenu[$item[2]]) ) $class[] = 'wp-has-current-submenu wp-menu-open'; else $class[] = 'current'; } elseif ( ! empty( $submenu[ $item[2] ] ) && isset( $user_settings[ 'm' . $menu_setting_increment ] ) && 'o' == $user_settings[ 'm' . $menu_setting_increment ] ) { $class[] = 'wp-menu-open'; } if ( ! empty($item[4]) ) $class[] = $item[4]; $class = $class ? ' class="' . join( ' ', $class ) . '"' : ''; $tabindex = ' tabindex="1"'; $id = ! empty($item[5]) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : ''; $img = ''; if ( ! empty($item[6]) ) { if ( 'div' === $item[6] ) $img = '
'; else $img = ''; } $toggle = ''; $arrow = ''; $title = wptexturize($item[0]); echo "\n\t"; if ( false !== strpos($class, 'wp-menu-separator') ) { echo '
'; } elseif ( $submenu_as_parent && !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); $menu_file = $submenu[$item[2]][0][2]; if ( false !== $pos = strpos($menu_file, '?') ) $menu_file = substr($menu_file, 0, $pos); if ( ( ('index.php' != $submenu[$item[2]][0][2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") ) || !empty($menu_hook)) { $admin_is_parent = true; echo "$arrow$toggle$title"; } else { echo "\n\t$arrow$toggle$title"; } } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); $menu_file = $item[2]; if ( false !== $pos = strpos($menu_file, '?') ) $menu_file = substr($menu_file, 0, $pos); if ( ('index.php' != $item[2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") || !empty($menu_hook) ) { $admin_is_parent = true; echo "\n\t$arrow$toggle{$item[0]}"; } else { echo "\n\t$arrow$toggle{$item[0]}"; } } if ( !empty($submenu[$item[2]]) ) { echo "\n\t
{$item[0]}
"; } echo ""; } } ?>