WordPress.org

Make WordPress Core

Ticket #43697: 43697.patch

File 43697.patch, 1.3 KB (added by mukesh27, 20 months ago)
  • menu.php

    diff -Naur old/menu.php new/menu.php
    old new  
    168168$appearance_cap = current_user_can( 'switch_themes' ) ? 'switch_themes' : 'edit_theme_options';
    169169
    170170$menu[60]                     = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
    171         $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' );
     171        $theme_update_count = '';
     172        if ( ! is_multisite() && current_user_can( 'update_plugins' ) ) {
     173                if ( ! isset( $update_data ) ) {
     174                        $update_data = wp_get_update_data();
     175                }
     176                $theme_update_count = "<span class='update-plugins count-{$update_data['counts']['themes']}'><span class='theme-count'>" . number_format_i18n( $update_data['counts']['themes'] ) . '</span></span>';
     177        }
     178        $submenu['themes.php'][5] = array( sprintf( __('Themes %s'), $theme_update_count ), $appearance_cap, 'themes.php' );
    172179
    173180        $customize_url            = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
    174181        $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );