WordPress.org

Make WordPress Core

Ticket #14435: 14435.11.diff

File 14435.11.diff, 2.5 KB (added by PeteMall, 3 years ago)

Remove plugin update notification from site admin in multisite installs.

  • wp-admin/includes/update.php

     
    192192 
    193193        $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $r->slug . '&TB_iframe=true&width=600&height=800'); 
    194194 
    195         echo '<tr class="plugin-update-tr"><td colspan="3" class="plugin-update"><div class="update-message">'; 
    196         if ( ! current_user_can('update_plugins') ) 
    197                 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); 
    198         else if ( empty($r->package) ) 
    199                 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic upgrade is unavailable for this plugin.</em>'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); 
    200         else 
    201                 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">upgrade automatically</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) ); 
     195        if ( is_network_admin() || !is_multisite() ) { 
     196                echo '<tr class="plugin-update-tr"><td colspan="3" class="plugin-update"><div class="update-message">'; 
     197                if ( ! current_user_can('update_plugins') ) 
     198                        printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); 
     199                else if ( empty($r->package) ) 
     200                        printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic upgrade is unavailable for this plugin.</em>'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); 
     201                else 
     202                        printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">upgrade automatically</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) ); 
     203        } 
    202204 
    203205        do_action( "in_plugin_update_message-$file", $plugin_data, $r ); 
    204206