Ticket #20373: 20373-2.patch
File 20373-2.patch, 3.0 KB (added by , 12 years ago) |
---|
-
wp-admin/menu-header.php
66 66 $class[] = $item[4]; 67 67 68 68 $class = $class ? ' class="' . join( ' ', $class ) . '"' : ''; 69 $id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : ''; 69 $id = ! empty( $item[5] ) ? preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) : 'wp-menu-' . $key; 70 $link_id = $id . '-link'; 71 70 72 $img = ''; 71 73 if ( ! empty( $item[6] ) ) 72 74 $img = ( 'div' === $item[6] ) ? '<br />' : '<img src="' . $item[6] . '" alt="" />'; 75 73 76 $arrow = '<div class="wp-menu-arrow"><div></div></div>'; 74 75 77 $title = wptexturize( $item[0] ); 76 78 77 echo "\n\t<li$class $id>";79 echo "\n\t<li$class id='$id'>"; 78 80 79 81 if ( false !== strpos( $class, 'wp-menu-separator' ) ) { 80 82 echo '<div class="separator"></div>'; … … 86 88 $menu_file = substr( $menu_file, 0, $pos ); 87 89 if ( ! empty( $menu_hook ) || ( ('index.php' != $submenu_items[0][2]) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) ) ) { 88 90 $admin_is_parent = true; 89 echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu_items[0][2]}' >$img</a></div>$arrow<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$title</a>";91 echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu_items[0][2]}' aria-labelledby='$link_id'>$img</a></div>$arrow<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes id='$link_id'>$title</a>"; 90 92 } else { 91 echo "\n\t<div class='wp-menu-image'><a href='{$submenu_items[0][2]}' >$img</a></div>$arrow<a href='{$submenu_items[0][2]}'$class $aria_attributes>$title</a>";93 echo "\n\t<div class='wp-menu-image'><a href='{$submenu_items[0][2]}' aria-labelledby='$link_id'>$img</a></div>$arrow<a href='{$submenu_items[0][2]}'$class $aria_attributes id='$link_id'>$title</a>"; 92 94 } 93 95 } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { 94 96 $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' ); … … 97 99 $menu_file = substr( $menu_file, 0, $pos ); 98 100 if ( ! empty( $menu_hook ) || ( ('index.php' != $item[2]) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) ) ) { 99 101 $admin_is_parent = true; 100 echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}' >$img</a></div>$arrow<a href='admin.php?page={$item[2]}'$class $aria_attributes>{$item[0]}</a>";102 echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}' aria-labelledby='$link_id'>$img</a></div>$arrow<a href='admin.php?page={$item[2]}'$class $aria_attributes id='$link_id'>{$item[0]}</a>"; 101 103 } else { 102 echo "\n\t<div class='wp-menu-image'><a href='{$item[2]}' >$img</a></div>$arrow<a href='{$item[2]}'$class $aria_attributes>{$item[0]}</a>";104 echo "\n\t<div class='wp-menu-image'><a href='{$item[2]}' aria-labelledby='$link_id'>$img</a></div>$arrow<a href='{$item[2]}'$class $aria_attributes id='$link_id'>{$item[0]}</a>"; 103 105 } 104 106 } 105 107