Ticket #16923: 16923.diff
File 16923.diff, 3.4 KB (added by , 14 years ago) |
---|
-
wp-admin/update.php
146 146 147 147 include(ABSPATH . 'wp-admin/admin-footer.php'); 148 148 149 } elseif ( 'sideload-plugin' == $action ) { 150 151 if ( ! current_user_can('install_plugins') ) 152 wp_die(__('You do not have sufficient permissions to install plugins for this site.')); 153 154 check_admin_referer('plugin-sideload'); 155 156 $download_url = esc_url_raw( stripslashes( $_POST['pluginurl'] ) ); 157 158 $title = __('Plugin Install'); 159 $parent_file = 'plugins.php'; 160 $submenu_file = 'plugin-install.php'; 161 require_once(ABSPATH . 'wp-admin/admin-header.php'); 162 163 $title = sprintf( __('Installing Plugin from URL: %s'), $download_url ); 164 $nonce = 'plugin-sideload'; 165 $url = 'update.php?action=sideload-plugin&pluginurl=' . urlencode( stripslashes( $_POST['pluginurl'] ) ); 166 167 $type = 'web'; 168 169 $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce') ) ); 170 $upgrader->install( $download_url ); 171 172 include(ABSPATH . 'wp-admin/admin-footer.php'); 173 149 174 } elseif ( 'upgrade-theme' == $action ) { 150 175 151 176 if ( ! current_user_can('update_themes') ) -
wp-admin/includes/class-wp-plugin-install-list-table.php
30 30 if ( 'search' == $tab ) 31 31 $tabs['search'] = __( 'Search Results' ); 32 32 $tabs['upload'] = __( 'Upload' ); 33 $tabs['url'] = __( 'From URL' ); 33 34 $tabs['featured'] = _x( 'Featured','Plugin Installer' ); 34 35 $tabs['popular'] = _x( 'Popular','Plugin Installer' ); 35 36 $tabs['new'] = _x( 'Newest','Plugin Installer' ); -
wp-admin/includes/plugin-install.php
136 136 /** 137 137 * Upload from zip 138 138 * @since 2.8.0 139 *140 * @param string $page141 139 */ 142 function install_plugins_upload( $page = 1) {140 function install_plugins_upload() { 143 141 ?> 144 142 <h4><?php _e('Install a plugin in .zip format') ?></h4> 145 143 <p class="install-help"><?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.') ?></p> … … 151 149 </form> 152 150 <?php 153 151 } 154 add_action('install_plugins_upload', 'install_plugins_upload' , 10, 1);152 add_action('install_plugins_upload', 'install_plugins_upload'); 155 153 156 154 /** 155 * Sideload from arbitrary URL 156 * @since 3.1.0 157 */ 158 function install_plugins_url() { 159 ?> 160 <h4><?php _e('Install a plugin from a URL') ?></h4> 161 <p class="install-help"><?php _e('If you have the URL to a plugin in .zip format, you may install it by providing the URL here.') ?></p> 162 <form method="post" action="<?php echo self_admin_url('update.php?action=sideload-plugin') ?>"> 163 <?php wp_nonce_field( 'plugin-sideload' ) ?> 164 <label class="screen-reader-text" for="pluginzip"><?php _e('URL to Plugin zip file'); ?></label> 165 <input type="input" type="text" class="large-text" id="pluginurl" name="pluginurl" /> 166 <input type="submit" class="button" value="<?php esc_attr_e('Install Now') ?>" /> 167 </form> 168 <?php 169 } 170 add_action('install_plugins_url', 'install_plugins_url'); 171 172 /** 157 173 * Display plugin content based on plugin list. 158 174 * 159 175 * @since 2.7.0