DB
1 year ago
ActivationDatabaseHook.php
2 years ago
ActivationMultisite.php
7 years ago
ActivationNewSiteMultisite.php
7 years ago
ActivationRolesHook.php
7 years ago
ActivationSettingsHook.php
1 year ago
AutoUpdateHook.php
3 years ago
DeleteDatabaseHook.php
2 years ago
DeletionMultisite.php
5 years ago
ActivationNewSiteMultisite.php
31 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Multisite hook on new site activation |
| 4 | */ |
| 5 | |
| 6 | namespace AmeliaBooking\Infrastructure\WP\InstallActions; |
| 7 | |
| 8 | /** |
| 9 | * Class ActivationNewSiteMultisite |
| 10 | * |
| 11 | * @package AmeliaBooking\Infrastructure\WP\InstallActions |
| 12 | */ |
| 13 | class ActivationNewSiteMultisite |
| 14 | { |
| 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_SLUG)) { |
| 24 | switch_to_blog($siteId); |
| 25 | //Create database table if not exists |
| 26 | ActivationDatabaseHook::init(); |
| 27 | restore_current_blog(); |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 |