|
185 | 185 |
|
186 | 186 | $appearance_cap = current_user_can( 'switch_themes' ) ? 'switch_themes' : 'edit_theme_options'; |
187 | 187 |
|
188 | | -$menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); |
189 | | - $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' ); |
| 188 | +$menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); |
| 189 | + |
| 190 | +$count = ''; |
| 191 | +if ( ! is_multisite() && current_user_can( 'update_themes' ) ) { |
| 192 | + if ( ! isset( $update_data ) ) { |
| 193 | + $update_data = wp_get_update_data(); |
| 194 | + } |
| 195 | + $count = sprintf( |
| 196 | + '<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>', |
| 197 | + $update_data['counts']['themes'], |
| 198 | + number_format_i18n( $update_data['counts']['themes'] ) |
| 199 | + ); |
| 200 | +} |
| 201 | + |
| 202 | + /* translators: %s: Number of available theme updates. */ |
| 203 | + $submenu['themes.php'][5] = array( sprintf( __( 'Themes %s' ), $count ), $appearance_cap, 'themes.php' ); |
190 | 204 |
|
191 | 205 | $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' ); |
192 | 206 | $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); |
@@ -236,7 +250,7 @@ function _add_themes_utility_last() { |
236 | 250 | ); |
237 | 251 | } |
238 | 252 |
|
239 | | -/* translators: %s: Number of pending plugin updates. */ |
| 253 | +/* translators: %s: Number of available plugin updates. */ |
240 | 254 | $menu[65] = array( sprintf( __( 'Plugins %s' ), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' ); |
241 | 255 |
|
242 | 256 | $submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'activate_plugins', 'plugins.php' ); |
|
0 commit comments