WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/28/2010 08:31:16 AM (9 years ago)
Author:
nacin
Message:

Don't show plugin update notifications outside of the network admin. props PeteMall, see #14435.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/update.php

    r15867 r16037  
    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 );
Note: See TracChangeset for help on using the changeset viewer.