WordPress.org

Make WordPress Core

Ticket #5117: unknown_plugins_notice.diff

File unknown_plugins_notice.diff, 1.3 KB (added by strider72, 7 years ago)

Adds a "Not checked for updates" notice if the update status of a plugin is unknown

Line 
1diff -r -x wp-config.php trac/wp-admin/includes/update.php control/wp-admin/includes/update.php
2114,118d113
3<       // testing purposes
4<       // Assumes that server response will be changed to include an array "unknown-plugins" containing elements of $plugin_file=>true for all the plugins for which it doesn't have data.
5<       $response['unknown_plugins'] =  array('kill_messages.php'=>true,'kill_one_message.php'=>true);
6< //    error_log( print_r($response,true) );
7<
8146,156d140
9< function wp_plugin_update_unknown( $file ) {
10<       $current = get_option( 'update_plugins' );
11<       $output = '';
12<       if ( isset( $current->response['unknown_plugins'][ $file ] ) ) {
13<               $output = __('Not Checked for Updates');
14<               $output = "<br /><span class=\"updatenotice\">{$output}</span>";
15<       }
16<       $output = apply_filters('plugin_updates_unknown', $output, $file );
17<       return $output;
18< }
19<
20diff -r -x wp-config.php trac/wp-admin/plugins.php control/wp-admin/plugins.php
21146c146
22<               <td class='vers'>{$plugin_data['Version']}" . wp_plugin_update_unknown($plugin_file) . "</td>
23---
24>               <td class='vers'>{$plugin_data['Version']}</td>
25diff -r -x wp-config.php trac/wp-admin/wp-admin.css control/wp-admin/wp-admin.css
265,15d4
27< #plugins span.updatenotice {
28<       display: block;
29<       margin-top: .5em;
30<       font-style: italic;
31<       font-size: 85%;
32< }
33<
34< #plugins .vers {
35<       width: 7em;
36< }
37<