diff --git a/src/wp-admin/includes/menu.php b/src/wp-admin/includes/menu.php
index cea9c758f1..4d720f2626 100644
|
a
|
b
|
foreach ( $menu as $id => $data ) { |
| 185 | 185 | } |
| 186 | 186 | unset( $id, $data, $subs, $first_sub ); |
| 187 | 187 | |
| | 188 | // Hide the tools page if it's going to be empty. |
| | 189 | $manage_taxonomies = false; |
| | 190 | if ( current_user_can( 'import' ) ) { |
| | 191 | $cats = get_taxonomy('category'); |
| | 192 | $tags = get_taxonomy('post_tag'); |
| | 193 | if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) { |
| | 194 | $manage_taxonomies = true; |
| | 195 | } |
| | 196 | } |
| | 197 | if ( ! isset( $submenu['tools.php'] ) && ! $manage_taxonomies && ! has_action( 'tool_box' ) ) { |
| | 198 | foreach ( $menu as $i => $data ) { |
| | 199 | if ( 'tools.php' == $data[2] ) { |
| | 200 | unset( $menu[ $i ] ); |
| | 201 | break; |
| | 202 | } |
| | 203 | } |
| | 204 | unset( $data ); |
| | 205 | } |
| | 206 | |
| 188 | 207 | /** |
| 189 | 208 | * @param string $add |
| 190 | 209 | * @param string $class |