diff --git a/src/wp-admin/includes/menu.php b/src/wp-admin/includes/menu.php
index cea9c75..11736f0 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 |
diff --git a/src/wp-admin/tools.php b/src/wp-admin/tools.php
index b61d71f..a30b2bc 100644
a
|
b
|
if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap-> |
40 | 40 | </div> |
41 | 41 | <?php |
42 | 42 | endif; |
| 43 | else : |
| 44 | ?> |
| 45 | <p><?php _e( 'Sorry, nothing you can access right now.' ); ?></p> |
| 46 | <?php |
43 | 47 | endif; |
44 | 48 | |
45 | 49 | /** |