Make WordPress Core

Ticket #43697: 43697.2.patch

File 43697.2.patch, 1.3 KB (added by mukesh27, 6 years ago)

updated patch

  • wp-admin/menu.php

    diff -Naur wp-admin/menu.php wp-admin/menu.php
     
    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_themes' ) ) {
     173                if ( ! isset( $update_data ) ) {
     174                        $update_data = wp_get_update_data();
     175                }
     176                $theme_update_count = "<span class='update-themes 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' );