DB
2 weeks ago
ActivationDatabaseHook.php
6 months ago
ActivationMultisite.php
1 year ago
ActivationNewSiteMultisite.php
1 month ago
ActivationRolesHook.php
1 year ago
ActivationSettingsHook.php
2 weeks ago
AutoUpdateHook.php
1 month ago
DeleteDatabaseHook.php
1 year ago
DeletionMultisite.php
1 year ago
ActivationNewSiteMultisite.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Multisite hook on new site activation |
| 5 | */ |
| 6 | |
| 7 | namespace AmeliaBooking\Infrastructure\WP\InstallActions; |
| 8 | |
| 9 | /** |
| 10 | * Class ActivationNewSiteMultisite |
| 11 | * |
| 12 | * @package AmeliaBooking\Infrastructure\WP\InstallActions |
| 13 | */ |
| 14 | class ActivationNewSiteMultisite |
| 15 | { |
| 16 | /** |
| 17 | * Activate the plugin for every newly created site if the plugin is network activated |
| 18 | * |
| 19 | * @param $siteId |
| 20 | */ |
| 21 | public static function init($siteId) |
| 22 | { |
| 23 | if (is_plugin_active_for_network(AMELIA_PLUGIN_BASENAME)) { |
| 24 | switch_to_blog($siteId); |
| 25 | //Create database table if not exists |
| 26 | ActivationDatabaseHook::init(); |
| 27 | restore_current_blog(); |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 |