WordPress.org

Make WordPress Core

Ticket #17406: 17406.diff

File 17406.diff, 1.5 KB (added by Otto42, 3 years ago)

Patch to add View Version X details to Update-core page, for plugins.

  • update-core.php

     
    99/** WordPress Administration Bootstrap */ 
    1010require_once('./admin.php'); 
    1111 
     12wp_enqueue_style( 'plugin-install' ); 
     13wp_enqueue_script( 'plugin-install' ); 
     14add_thickbox(); 
     15         
    1216if ( is_multisite() && ! is_network_admin() ) { 
    1317        wp_redirect( network_admin_url( 'update-core.php' ) ); 
    1418        exit(); 
     
    239243                } else { 
    240244                        $upgrade_notice = ''; 
    241245                } 
     246                 
     247                $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&TB_iframe=true&width=640&height=662'); 
     248                $details_text = sprintf(__('View version %1$s details'), $plugin_data->update->new_version);  
     249                $details = sprintf('<br /><a href="%1$s" class="thickbox" title="%2$s">%3$s</a>.', esc_url($details_url), esc_attr($plugin_data->Name), $details_text); 
     250                 
    242251                echo " 
    243252        <tr class='active'> 
    244253                <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th> 
    245                 <td><strong>{$plugin_data->Name}</strong><br />" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td> 
     254                <td><strong>{$plugin_data->Name}</strong><br />" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . $details . "</td> 
    246255        </tr>"; 
    247256        } 
    248257?>