WordPress.org

Make WordPress Core

Ticket #6332: 6332.diff

File 6332.diff, 843 bytes (added by DD32, 6 years ago)

use is_plugin_active() instead.

  • wp-admin/includes/plugin.php

     
    122122                $plugins = array($plugins); 
    123123 
    124124        foreach ( $plugins as $plugin ) { 
    125                 $item = array_search( $plugin, $current); 
    126                 if( false === $item) 
     125                if( ! is_plugin_active($plugin) ) 
    127126                        continue; 
    128                 if ( ( $key = array_search( $plugin, $current) ) !== false ) 
    129                         array_splice($current, $key, 1 ); // Fixed Array-fu! 
    130                 if ( ! $silent ) 
     127                array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu! 
     128                if ( ! $silent ) //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output. 
    131129                        do_action('deactivate_' . trim( $plugin )); 
    132130        } 
    133131