Changeset 41359
- Timestamp:
- 09/09/2017 02:49:53 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/menu-header.php
r41200 r41359 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'; … … 179 184 180 185 $class = array(); 186 $aria_attributes = ''; 181 187 if ( $first ) { 182 188 $class[] = 'wp-first-item'; … … 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. … … 202 210 ) { 203 211 $class[] = 'current'; 212 $aria_attributes .= ' aria-current="page"'; 204 213 } 205 214 … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.