store); } public function rights(): ?WP_Error { return DesignRights::customCss($this->options); } public function features(): array { return [DiviFeature::ThemeOptionRead, DiviFeature::ThemeOptionWrite]; } public function plan(array $current, array $snapshot, string $snapshotId): DesignPlan|WP_Error { $stylesheet = (string) ($current['stylesheet'] ?? ''); if ((string) ($snapshot['stylesheet'] ?? '') !== $stylesheet) { return Errors::invalidInput( sprintf( 'Der Snapshot gehört zum Theme „%s“, aktiv ist „%s“; nichts wurde gespeichert.', (string) ($snapshot['stylesheet'] ?? '?'), $stylesheet ), ['snapshot' => 'Das passende Theme aktivieren oder einen Snapshot dieses Themes wählen.'] ); } $before = (string) ($current['css'] ?? ''); $after = (string) ($snapshot['css'] ?? ''); return new DesignPlan( ['stylesheet' => $stylesheet, 'css' => $after], CustomCssDiff::between($before, $after), sprintf('Snapshot %s wiederherstellen – %s', $snapshotId, CustomCssDiff::summary($before, $after)), null, $before === $after ? [] : [CustomCssArea::SITE_WIDE], true ); } }