WordPress.org

Make WordPress Core

Changeset 29817


Ignore:
Timestamp:
10/02/2014 03:48:36 PM (5 years ago)
Author:
wonderboymusic
Message:

Network Admin Menu:

  • Don't display update count for Themes when the user doesn't have the 'update_themes' cap
  • Don't display update count for Plugins when there aren't any/count is 0

Props peterchester.
Fixes #29651.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/menu.php

    r27444 r29817  
    2424$update_data = wp_get_update_data();
    2525
    26 if ( $update_data['counts']['themes'] ) {
     26if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
    2727    $menu[15] = array(sprintf( __( 'Themes %s' ), "<span class='update-plugins count-{$update_data['counts']['themes']}'><span class='theme-count'>" . number_format_i18n( $update_data['counts']['themes'] ) . "</span></span>" ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
    2828} else {
     
    3333$submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
    3434
    35 if ( current_user_can( 'update_plugins' ) ) {
     35if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
    3636    $menu[20] = array( sprintf( __( 'Plugins %s' ), "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . "</span></span>" ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins');
    3737} else {
Note: See TracChangeset for help on using the changeset viewer.