Make WordPress Core

Ticket #24205: 24205.2.patch

File 24205.2.patch, 1.0 KB (added by noam@…, 11 years ago)

Sane default

  • plugin.php

     
    432432 * @since 2.5.0
    433433 *
    434434 * @param string $plugin Base plugin path from plugins directory.
     435 * @param bool $check_all Defaults true. On true, checks mu-plugins and dropins for existence.
    435436 * @return bool True, if in the active plugins list. False, not in the list.
    436437 */
    437 function is_plugin_active( $plugin ) {
    438         return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || is_plugin_active_for_network( $plugin );
     438function is_plugin_active( $plugin, $check_all=true ) {
     439        if ( $check_all ) {
     440                $mu_plugins = get_mu_plugins();
     441               
     442                if ( array_key_exists( $plugin, $mu_plugins ) )
     443                        return true;
     444               
     445                $dropins = get_dropins();
     446               
     447                if ( array_key_exists( $plugin, $dropins ) )
     448                        return true;           
     449        }
     450       
     451        return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || is_plugin_active_for_network( $plugin );
    439452}
    440453
    441454/**