WordPress.org

Make WordPress Core

Ticket #5117: unknown_plugins_notice_v2.diff

File unknown_plugins_notice_v2.diff, 1.5 KB (added by strider72, 7 years ago)

Changed assumed server data return per comment #26 (specifies both unknown and up-to-date)

Line 
1diff -r 2_5_1/wp-admin/includes/update.php test/wp-admin/includes/update.php
2113a114,118
3>       // testing purposes
4>       // Assumes that server response will be changed to include a new element: an array "other_plugins" containing elements of $plugin_file=>'unknown' or $plugin_filename=>'current' for all the plugins for which it doesn't show updates.
5>       $response['other_plugins'] =  array('kill_messages.php'=>'unknown','kill_one_message.php'=>'unknown');
6>       error_log( print_r($response,true) );
7>
8140a146,157
9> function wp_plugin_update_unknown( $file ) {
10>       $current = get_option( 'update_plugins' );
11>       $output = '';
12>       if (    ( isset( $current->response['other_plugins'][ $file ] ) &&
13>                       $current->response['other_plugins'][ $file ] == 'unknown' ) ) {
14>               $output = __('Not Checked for Updates');
15>               $output = "<br /><span class=\"updatenotice\">{$output}</span>";
16>       }
17>       $output = apply_filters('plugin_updates_unknown', $output, $file );
18>       return $output;
19> }
20>
21diff -r 2_5_1/wp-admin/plugins.php test/wp-admin/plugins.php
22146c146
23<               <td class='vers'>{$plugin_data['Version']}</td>
24---
25>               <td class='vers'>{$plugin_data['Version']}" . wp_plugin_update_unknown($plugin_file) . "</td>
26diff -r 2_5_1/wp-admin/wp-admin.css test/wp-admin/wp-admin.css
274a5,15
28> #plugins span.updatenotice {
29>       display: block;
30>       margin-top: .5em;
31>       font-style: italic;
32>       font-size: 85%;
33> }
34>
35> #plugins .vers {
36>       width: 7em;
37> }
38>
39Only in test/wp-content/plugins: kill_messages.php
40Only in test/wp-content/plugins: kill_one_message.php