Ticket #17902: 17902-plugin-details-link.diff
File 17902-plugin-details-link.diff, 3.8 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/class-wp-plugins-list-table.php
108 108 unset( $recently_activated[$key] ); 109 109 update_option( 'recently_activated', $recently_activated ); 110 110 } 111 112 $plugin_info = get_site_transient( 'update_plugins' ); 111 113 112 114 foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) { 115 // Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide. 116 if ( isset( $plugin_info->response[ $plugin_file ] ) ) { 117 $plugins['all'][$plugin_file] = $plugin_data = array_merge( (array)$plugin_info->response[ $plugin_file ], $plugin_data ); 118 } elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) { 119 $plugins['all'][$plugin_file] = $plugin_data = array_merge( (array)$plugin_info->no_update[ $plugin_file ], $plugin_data ); 120 } 121 113 122 // Filter into individual sections 114 123 if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) { 115 124 // On the non-network screen, filter out network-only plugins as long as they're not individually activated … … 344 353 $actions = array( 345 354 'deactivate' => '', 346 355 'activate' => '', 356 'details' => '', 347 357 'edit' => '', 348 358 'delete' => '', 349 359 ); … … 392 402 if ( ! is_multisite() && current_user_can('delete_plugins') ) 393 403 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 394 404 } // end if $is_active 405 406 // Extra data from the updates API, if available 407 if ( isset( $plugin_data['slug'] ) ) { 408 $actions['details'] = '<a href="' . self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] . 409 '&TB_iframe=true&width=600&height=550' ) . '" class="thickbox" title="' . 410 esc_attr( sprintf( __( 'More information about %s' ), $plugin_data['Name'] ) ) . '">' . __( 'Details' ) . '</a>'; 411 } 412 395 413 } // end if $screen->in_admin( 'network' ) 396 414 397 415 if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) -
wp-includes/update.php
277 277 'plugins' => json_encode( $to_send ), 278 278 'translations' => json_encode( $translations ), 279 279 'locale' => json_encode( $locales ), 280 'all' => json_encode( true ), 280 281 ), 281 282 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) 282 283 ); … … 286 287 } 287 288 288 289 $url = $http_url = 'http://api.wordpress.org/plugins/update-check/1.1/'; 290 289 291 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) 290 292 $url = set_url_scheme( $url, 'https' ); 291 293 … … 303 305 $plugin = (object) $plugin; 304 306 } 305 307 unset( $plugin ); 308 foreach ( $response['no_update'] as &$plugin ) { 309 $plugin = (object) $plugin; 310 } 311 unset( $plugin ); 306 312 307 313 if ( is_array( $response ) ) { 308 314 $new_option->response = $response['plugins']; 309 315 $new_option->translations = $response['translations']; 316 // TODO: Perhaps better to store no_update in a separate transient with an expiry? 317 $new_option->no_update = $response['no_update']; 310 318 } else { 311 319 $new_option->response = array(); 312 320 $new_option->translations = array(); 321 $new_option->no_update = array(); 313 322 } 314 323 315 324 set_site_transient( 'update_plugins', $new_option );