Ticket #41589: 41589.diff
File 41589.diff, 2.2 KB (added by , 7 years ago) |
---|
-
src/wp-admin/menu-header.php
89 89 } 90 90 91 91 if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) { 92 $class[] = ! empty( $submenu_items ) ? 'wp-has-current-submenu wp-menu-open' : 'current'; 92 if ( ! empty( $submenu_items ) ) { 93 $class[] = 'wp-has-current-submenu wp-menu-open'; 94 } else { 95 $class[] = 'current'; 96 $aria_attributes .= 'aria-current="page"'; 97 } 93 98 } else { 94 99 $class[] = 'wp-not-current-submenu'; 95 100 if ( ! empty( $submenu_items ) ) … … 178 183 continue; 179 184 180 185 $class = array(); 186 $aria_attributes = ''; 181 187 if ( $first ) { 182 188 $class[] = 'wp-first-item'; 183 189 $first = false; … … 192 198 $self_type = ! empty( $typenow ) ? $self . '?post_type=' . $typenow : 'nothing'; 193 199 194 200 if ( isset( $submenu_file ) ) { 195 if ( $submenu_file == $sub_item[2] ) 201 if ( $submenu_file == $sub_item[2] ) { 196 202 $class[] = 'current'; 203 $aria_attributes .= ' aria-current="page"'; 204 } 197 205 // If plugin_page is set the parent must either match the current page or not physically exist. 198 206 // This allows plugin pages with the same hook to exist under different parents. 199 207 } elseif ( … … 201 209 ( isset( $plugin_page ) && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists($menu_file) === false ) ) 202 210 ) { 203 211 $class[] = 'current'; 212 $aria_attributes .= ' aria-current="page"'; 204 213 } 205 214 206 215 if ( ! empty( $sub_item[4] ) ) { … … 224 233 $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), 'admin.php' ); 225 234 226 235 $sub_item_url = esc_url( $sub_item_url ); 227 echo "<li$class><a href='$sub_item_url'$class >$title</a></li>";236 echo "<li$class><a href='$sub_item_url'$class$aria_attributes>$title</a></li>"; 228 237 } else { 229 echo "<li$class><a href='{$sub_item[2]}'$class >$title</a></li>";238 echo "<li$class><a href='{$sub_item[2]}'$class$aria_attributes>$title</a></li>"; 230 239 } 231 240 } 232 241 echo "</ul>";