'ids', 'number' => 0]) as $site_id) { switch_to_blog((int) $site_id); self::removeSiteData(); restore_current_blog(); } } public static function removeSiteData(): void { global $wpdb; foreach (self::OPTIONS as $option) { delete_option($option); } foreach (self::TRANSIENTS as $transient) { delete_transient($transient); } wp_clear_scheduled_hook(self::CRON_HOOK); $table = $wpdb->prefix . self::TABLE; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- own table name, not user input. $wpdb->query("DROP TABLE IF EXISTS {$table}"); } }