[wp-trac] [WordPress Trac] #52405: activate_{$plugin} not passing $network_wide boolean to action handler
WordPress Trac
noreply at wordpress.org
Sun Jan 31 07:19:07 UTC 2021
#52405: activate_{$plugin} not passing $network_wide boolean to action handler
---------------------------------------+-----------------------------------
Reporter: noplanman | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: trunk
Severity: normal | Keywords: has-patch needs-
Focuses: administration, multisite | testing
---------------------------------------+-----------------------------------
When using {{{register_activation_hook}}}, the {{{"activate_{$plugin}"}}}
action doesn't pass the {{{$network_wide}}} boolean as the parameter for
the callback.
Instead, the parameter gets substituted with an empty string, breaking the
page when using strict typing, as it expects a boolean.
Looking at how it's done when activating plugins, it uses
{{{is_network_admin()}}} as the parameter
https://core.trac.wordpress.org/browser/trunk/src/wp-
admin/plugins.php?rev=49683#L124
Same thing should happen here:
https://core.trac.wordpress.org/browser/trunk/src/wp-
admin/plugins.php?rev=49683#L193
{{{do_action( "activate_{$plugin}", is_network_admin() );}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52405>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list