'ids', 'number' => 0, ) ) as $site_id ) { switch_to_blog( (int) $site_id ); self::activate_site(); restore_current_blog(); } return; } self::activate_site(); } /** * Performs the activation tasks for the current site. */ private static function activate_site(): void { if ( ! get_option( self::INSTALLED_OPTION ) ) { add_option( self::INSTALLED_OPTION, time() ); } /* * Called directly rather than through a hook: `plugins_loaded` has already * fired by the time an activation hook runs, so no plugin module has been * able to attach a listener yet. */ Installer::install(); DirectoryGuard::ensure(); update_option( self::VERSION_OPTION, FORMPILOT_VERSION ); /** * Fires while the plugin is being activated on a single site, after the * tables have been created. * * Default settings and seed data hook in here. * * @since 1.0.0 */ do_action( 'formpilot_activate' ); flush_rewrite_rules(); } }