#42511 closed feature request (duplicate)
register_activation_hook with MultiSite
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | |
Focuses: | multisite | Cc: |
Description
I think, it will be good, if any parameter/method will be added with that function, like:
register_activation_hook(__file__ ,'myFunc', $FORCE_MULTISITE_BLOGS = true);
where the third parameter will indicate, if the activation happens in Network (multisite) dashboard, then the plugin should be activated for each sub-blog.
There is one problem:
define('variable_XYZ', home_url() ); function myFunc(){ update_option('smth', variable_XYZ ); }
so, if just "myFunc" will be executed in the loop for each sub-blog, then there will be problems... So, I think, whole plugin should be "sandboxed" (i dont know what termin should be used) and whole plugin activation should happen for each sub-site, and not just "myFunc".
Change History (3)
Note: See
TracTickets for help on using
tickets.
@tazotodua it's not entirely clear what you're looking for here - since [16011] the (de)activation hooks are passed the
$network_wide
parameter which indicates whether the plugin is being network activated. This would allow you to loop through the sub-sites as needed.As such I'm closing this as a duplicate of #14170 for now. If I've misunderstood or you have a use case which isn't covered by that, please feel free to re-open this ticket and provide some more details. :-)