WordPress.org

Make WordPress Core

Opened 2 years ago

#42511 new feature request

register_activation_hook with MultiSite

Reported by: tazotodua Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:
PR Number:

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 (0)

Note: See TracTickets for help on using tickets.