Ticket #2377: 2377.2.diff
| File 2377.2.diff, 4.6 KB (added by , 20 years ago) |
|---|
-
wp-includes/functions.php
2283 2283 return $wpdb->num_queries; 2284 2284 } 2285 2285 2286 function deactivate_plugins() { 2287 update_option('deactivated_plugins', get_settings('active_plugins')); 2288 update_option('active_plugins', array()); 2289 } 2290 2286 2291 ?> -
wp-settings.php
170 170 require(ABSPATH . '/my-hacks.php'); 171 171 } 172 172 173 if ( get_settings('active_plugins') ) {173 if ( get_settings('active_plugins') && !defined('WP_INSTALLING') ) { 174 174 $current_plugins = get_settings('active_plugins'); 175 175 if ( is_array($current_plugins) ) { 176 176 foreach ($current_plugins as $plugin) { -
wp-admin/wp-admin.css
712 712 .alternate.active .name { 713 713 background: #8B8; 714 714 } 715 .deactivated td { 716 background-color: #ccc; 717 color: #999 !important; 718 } 719 .deactivated td a.edit:hover { 720 background-color: #999; 721 } 715 722 716 723 /* A handy div class for hiding controls. 717 724 Some browsers will disable them when you -
wp-admin/plugins.php
4 4 if ( isset($_GET['action']) ) { 5 5 check_admin_referer(); 6 6 7 if ('activate' == $_GET['action'] ) {7 if ('activate' == $_GET['action'] || 'reactivate' == $_GET['action']) { 8 8 $current = get_settings('active_plugins'); 9 $deactivated = get_settings('deactivated_plugins'); 10 if (in_array($_GET['plugin'], $deactivated) && 'reactivate' == $_GET['action']) { 11 array_splice($deactivated, array_search( $_GET['plugin'], $deactivated), 1 ); // Array-fu! 12 update_option('deactivated_plugins', $deactivated); 13 //plugin will be activated in next if() 14 } 9 15 if (!in_array($_GET['plugin'], $current)) { 10 16 $current[] = trim( $_GET['plugin'] ); 11 17 sort($current); … … 69 75 70 76 if ( get_settings('active_plugins') ) 71 77 $current_plugins = get_settings('active_plugins'); 78 $deactivated_plugins = get_settings('deactivated_plugins'); 72 79 73 80 $plugins = get_plugins(); 74 81 … … 104 111 } else { 105 112 $action = "<a href='plugins.php?action=activate&plugin=$plugin_file' title='".__('Activate this plugin')."' class='edit'>".__('Activate')."</a>"; 106 113 } 114 if (!empty($deactivated_plugins) && in_array($plugin_file, $deactivated_plugins)) { 115 $style .= ' deactivated'; 116 $action = "<a href='plugins.php?action=reactivate&plugin=$plugin_file' title='".__('Reactivate this plugin')."' class='edit'>".__('Reactivate')."</a>"; 117 $plugin_data['Title'] .= ' <em>' . __('deactivated in upgrade') . '</em>'; 118 } 107 119 $plugin_data['Description'] = wp_kses($plugin_data['Description'], array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()) ); ; 108 120 if ($style != '') $style = 'class="' . $style . '"'; 109 121 echo " -
wp-admin/upgrade.php
75 75 break; 76 76 77 77 case 1: 78 deactivate_plugins(); 78 79 wp_cache_flush(); 79 80 make_db_current_silent(); 80 81 upgrade_all(); … … 87 88 ?> 88 89 <h2><?php _e('Step 1'); ?></h2> 89 90 <p><?php printf(__("There's actually only one step. So if you see this, you're done. <a href='%s'>Have fun</a>!"), $backto); ?></p> 91 92 <?php $deactivated = get_option('deactivated_plugins'); 93 if (is_array($deactivated) && count($deactivated)) { 94 <h3><?php _e('Deactivated plugins'); ?></h3> 95 <p><?php _e('When upgrading, plugins designed for the old version can sometimes break with the new version, causing your upgraded WordPress to have errors or sometime not be accessible at all. To be on the safe side, we've disabled all your plugins. On the plugins page the plugins you can reactivate the plugins you previously had activated one by one to make sure nothing breaks.'); ?></p> 96 97 <p><?php _e('Here's a list of the plugins you had activated before. Plugins that were previously activated are marked on the Plugins page.'); ?></p> 98 99 <ul> 100 <?php foreach ($deactivated as $plugin) { 101 $plugin_data = get_plugins_data($plugin); ?> 102 <li><?php echo $plugin_data['Title']; ?></li> 103 <?php } ?> 104 </ul> 105 <?php } ?> 90 106 91 107 <!-- 92 108 <pre>