Make WordPress Core

Ticket #32368: 32368.diff

File 32368.diff, 1.4 KB (added by dd32, 11 years ago)
  • src/wp-admin/includes/plugin.php

    function activate_plugin( $plugin, $redi 
    564564                         * {@see register_activation_hook()}. The dynamic portion of the
    565565                         * hook name, `$plugin`, refers to the plugin basename.
    566566                         *
    567567                         * If a plugin is silently activated (such as during an update),
    568568                         * this hook does not fire.
    569569                         *
    570570                         * @since 2.0.0
    571571                         *
    572572                         * @param bool $network_wide Whether to enable the plugin for all sites in the network
    573573                         *                           or just the current site. Multisite only. Default is false.
    574574                         */
    575575                        do_action( 'activate_' . $plugin, $network_wide );
    576576                }
    577577
    578578                if ( $network_wide ) {
     579                        $current = get_site_option( 'active_sitewide_plugins', array() );
    579580                        $current[$plugin] = time();
    580581                        update_site_option( 'active_sitewide_plugins', $current );
    581582                } else {
     583                        $current = get_option( 'active_plugins', array() );
    582584                        $current[] = $plugin;
    583585                        sort($current);
    584586                        update_option('active_plugins', $current);
    585587                }
    586588
    587589                if ( ! $silent ) {
    588590                        /**
    589591                         * Fires after a plugin has been activated.
    590592                         *
    591593                         * If a plugin is silently activated (such as during an update),
    592594                         * this hook does not fire.
    593595                         *
    594596                         * @since 2.9.0
    595597                         *
    596598                         * @param string $plugin       Plugin path to main plugin file with plugin data.