Make WordPress Core


Ignore:
Timestamp:
10/20/2010 02:16:03 PM (14 years ago)
Author:
ryan
Message:

Add plugin update notifications, plugin install, plugin update to the network admin screen. Props PeteMall. see #15129

File:
1 edited

Legend:

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

    r15519 r15867  
    102102        foreach ( (array)$api_tags as $tag )
    103103            $tags[ $tag['name'] ] = (object) array(
    104                                     'link' => esc_url( admin_url('plugin-install.php?tab=search&type=tag&s=' . urlencode($tag['name'])) ),
     104                                    'link' => esc_url( self_admin_url('plugin-install.php?tab=search&type=tag&s=' . urlencode($tag['name'])) ),
    105105                                    'name' => $tag['name'],
    106106                                    'id' => sanitize_title_with_dashes($tag['name']),
     
    144144    <h4><?php _e('Install a plugin in .zip format') ?></h4>
    145145    <p class="install-help"><?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.') ?></p>
    146     <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('update.php?action=upload-plugin') ?>">
     146    <form method="post" enctype="multipart/form-data" action="<?php echo self_admin_url('update.php?action=upload-plugin') ?>">
    147147        <?php wp_nonce_field( 'plugin-upload') ?>
    148148        <label class="screen-reader-text" for="pluginzip"><?php _e('Plugin zip file'); ?></label>
     
    196196                $version = $plugin->new_version;
    197197                if ( current_user_can('update_plugins') )
    198                     $url = wp_nonce_url(admin_url('update.php?action=upgrade-plugin&plugin=' . $update_file), 'upgrade-plugin_' . $update_file);
     198                    $url = wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=' . $update_file), 'upgrade-plugin_' . $update_file);
    199199                break;
    200200            }
     
    207207            if ( empty($installed_plugin) ) {
    208208                if ( current_user_can('install_plugins') )
    209                     $url = wp_nonce_url(admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug);
     209                    $url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug);
    210210            } else {
    211211                $key = array_shift( $key = array_keys($installed_plugin) ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers
     
    227227            // "install" & no directory with that slug
    228228            if ( current_user_can('install_plugins') )
    229                 $url = wp_nonce_url(admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug);
     229                $url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug);
    230230        }
    231231    }
Note: See TracChangeset for help on using the changeset viewer.