Repository navigation
v0.26.0
Added
-
POST /wp-json/deckwp/v1/theme-delete— new REST route that
removes an installed theme from disk via WP'sdelete_theme().
Triggered by the per-row Delete button on the dashboard's
Themes tab (which was a UI placeholder until this release).Body shape:
{ "slug": "twentytwentyfour" }Response 200 success:
{ "slug": "twentytwentyfour", "deleted": true, "error": null }Response 200 failure (theme not installed, active, parent of
active child, filesystem error):{ "slug": "...", "deleted": false, "error": "Cannot delete the active theme — activate a different theme first." }Safety checks (in order, all return clear error messages):
- Slug is non-empty (422 if missing)
- Theme exists on disk (matches stylesheet OR text-domain)
- Theme is NOT the active stylesheet
- Theme is NOT the parent of the active child theme
WP_Filesystem()init succeeds (host doesn't force
FTP/SSH credentials)delete_theme()succeeds- Re-read disk after
wp_clean_themes_cache()to verify
the theme is actually gone (defends against a future
core change that returns true before the directory is
removed)
Idempotent: deleting a theme that's already gone returns
deleted: falsewitherror: "not installed"rather than
404, so the dashboard's optimistic UI update doesn't reverse
on a race condition.HMAC-verified by
HmacVerifier. Distinct fromtheme-switch
(activation) because the safety + audit posture is different:
switch is reversible by re-switching; delete requires a full
re-install from the dashboard library to undo.
Wire contract change
Purely additive. Pre-v0.26.0 connectors 404 the new endpoint; the
dashboard's RemoteThemeDeleteTrigger (companion commit on the
dashboard repo) surfaces that as an operator-facing
"connector too old — update to v0.26.0+" message.