← All changes
|
backend/src/Services/InstallActions/ActivationMultisite.php
+3
-4
0.2
→
1.5.1
View file →
| @@ -5,12 +5,9 @@ | ||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | namespace IvyForms\Services\InstallActions; |
| 8 | 8 | |
| 9 | -// phpcs:disable PSR1.Files.SideEffects | |
| 10 | -if (!defined('ABSPATH')) { | |
| 11 | - exit; // Exit if accessed directly | |
| 12 | -} | |
| 9 | +use IvyForms\Common\Exceptions\InvalidArgumentException; | |
| 13 | 10 | |
| 14 | 11 | /** |
| 15 | 12 | * Class ActivationMultisite |
| 16 | 13 | * |
| @@ -19,8 +16,9 @@ | ||
| 19 | 16 | class ActivationMultisite |
| 20 | 17 | { |
| 21 | 18 | /** |
| 22 | 19 | * Activate the plugin for every sub-site separately |
| 20 | + * @throws InvalidArgumentException | |
| 23 | 21 | */ |
| 24 | 22 | public static function init(): void |
| 25 | 23 | { |
| 26 | 24 | global $wpdb; |
| @@ -35,8 +33,9 @@ | ||
| 35 | 33 | foreach ($siteIds as $siteId) { |
| 36 | 34 | switch_to_blog($siteId); |
| 37 | 35 | // Create database table if not exists |
| 38 | 36 | ActivationDatabaseHook::init(); |
| 37 | + ActivationCapabilitiesHook::ensureAdministratorCaps(); | |
| 39 | 38 | } |
| 40 | 39 | // Returns to current blog |
| 41 | 40 | switch_to_blog($oldSite); |
| 42 | 41 | } |