Make WordPress Core


Ignore:
Timestamp:
07/29/2026 08:26:30 PM (3 months ago)
Author:
westonruter
Message:

Plugins: Pass the missing $network_wide to activate_{$plugin}.

The action has documented a $network_wide parameter since r16011, which passed the flag to the de/activation hooks in activate_plugin() and deactivate_plugins(). However, the error scraping path in wp-admin/plugins.php re-fires the action to reproduce a fatal error, and was left passing no arguments at all. A callback registered through register_activation_hook() that declares the parameter therefore raised an ArgumentCountError while the error was being scraped.

This call site was surfaced by the PHPStan extensions under development for this ticket, which are committed separately.

Developed as subset of ​https://github.com/WordPress/wordpress-develop/pull/12022.
Follow-up to r9352, r16011.

See #65376, #14170.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/plugins.php

    r60929 r62931  
    194194                        plugin_sandbox_scrape( $plugin );
    195195                        /** This action is documented in wp-admin/includes/plugin.php */
    196                         do_action( "activate_{$plugin}" );
     196                        do_action( "activate_{$plugin}", is_network_admin() );
    197197                        exit;
    198198
Note: See TracChangeset for help on using the changeset viewer.