WordPress.org

Make WordPress Core

Ticket #14435: 14435.13.diff

File 14435.13.diff, 2.9 KB (added by PeteMall, 9 years ago)

Remove theme update notification, core update from site admin.

  • wp-admin/includes/theme.php

     
    241241                $update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet);
    242242                $update_onclick = 'onclick="if ( confirm(\'' . esc_js( __("Upgrading this theme will lose any customizations you have made.  'Cancel' to stop, 'OK' to upgrade.") ) . '\') ) {return true;}return false;"';
    243243
    244                 if ( ! current_user_can('update_themes') )
    245                         printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
    246                 else if ( empty($update['package']) )
    247                         printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Automatic upgrade is unavailable for this theme.</em>') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
    248                 else
    249                         printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a> or <a href="%4$s" %5$s>upgrade automatically</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick );
     244                if ( is_network_admin() || !is_multisite() ) {
     245                        if ( !current_user_can('update_themes') )
     246                                printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
     247                        else if ( empty($update['package']) )
     248                                printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Automatic upgrade is unavailable for this theme.</em>') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
     249                        else
     250                                printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a> or <a href="%4$s" %5$s>upgrade automatically</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick );
     251                }
    250252        }
    251253}
    252254
  • wp-admin/menu.php

     
    3030        if ( is_multisite() )
    3131                $submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );
    3232
    33         if ( is_super_admin() ) {
     33        if ( is_super_admin() && !is_multisite() ) {
    3434                $plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
    3535                $update_plugins = get_site_transient( 'update_plugins' );
    3636                if ( !empty($update_plugins->response) )