PHPackages                             s3rgiosan/wp-theme-json-editor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. s3rgiosan/wp-theme-json-editor

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

s3rgiosan/wp-theme-json-editor
==============================

A form-driven visual editor for WordPress theme.json files.

1.1.0(1mo ago)10GPL-3.0-onlyPHPPHP ^8.1

Since May 8Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/s3rgiosan/wp-theme-json-editor)[ Packagist](https://packagist.org/packages/s3rgiosan/wp-theme-json-editor)[ GitHub Sponsors](https://github.com/s3rgiosan)[ Fund](https://ko-fi.com/s3rgiosan)[ RSS](/packages/s3rgiosan-wp-theme-json-editor/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

WP Theme JSON Editor
====================

[](#wp-theme-json-editor)

> A form-driven visual editor for WordPress theme.json files.

[![Try in WordPress Playground](https://camo.githubusercontent.com/0e14183f548eb9dfe684735d24fdc74446b0cd73ee1558f93f10a2ec82ceea6a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f547279253230696e2d576f72645072657373253230506c617967726f756e642d3338353845393f6c6f676f3d776f72647072657373266c6f676f436f6c6f723d7768697465)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/s3rgiosan/wp-theme-json-editor/main/.wp-playground/blueprint.json)

Warning

This is a developer tool. It writes the active theme's `theme.json` directly to disk via `WP_Filesystem`.

- **No revisions, no backups.** Every Save overwrites the file in place.
- **No undo across sessions.** Once you save and reload, the previous content is gone.
- **No content validation beyond shape checks.** A malformed `theme.json` can break the front-end render and the Site Editor.

Treat it like any other code change to your theme: keep the theme under version control (git or a deployment pipeline), and only edit on environments where you can roll back if something goes wrong. Do not run it on production without a recent backup of `wp-content/themes/{your-theme}/theme.json`. If you want a visual editor that *does* keep revisions, use the WordPress Site Editor (Appearance → Editor → Styles). It edits user-level Global Styles instead of the theme file.

Description
-----------

[](#description)

WP Theme JSON Editor mounts a schema-driven form editor under **Appearance → Theme JSON Editor**, so the active block theme's `theme.json` can be edited from the WordPress admin without leaving the dashboard or hand-editing JSON.

The editor itself is the same React app that powers the [VS Code extension](https://github.com/s3rgiosan/vscode-wp-theme-json-editor) — sidebar navigation across `settings`, `styles`, `customTemplates`, `templateParts`, and `patterns`, inline schema validation, search, CSS-variable autocomplete, and optimistic-concurrency conflict detection.

The plugin only provides the WordPress integration: a host adapter that talks to the REST API, capability gating, and styling that follows the active admin colour scheme.

Requirements
------------

[](#requirements)

- WordPress 6.7 or later
- PHP 8.1 or later

Installation
------------

[](#installation)

### Manual Installation

[](#manual-installation)

1. Download the latest release ZIP from the [Releases page](https://github.com/s3rgiosan/wp-theme-json-editor/releases/latest).
2. Go to Plugins &gt; Add New &gt; Upload Plugin in your WordPress admin area.
3. Upload the ZIP file and click Install Now.
4. Activate the plugin.

### Install with Composer

[](#install-with-composer)

To include this plugin as a dependency in your Composer-managed WordPress project:

1. Add the plugin to your project using the following command:

```
composer require s3rgiosan/wp-theme-json-editor
```

1. Run `composer install`.
2. Activate the plugin from your WordPress admin area or using WP-CLI.

Quick Start
-----------

[](#quick-start)

Once activated, visit **Appearance → Theme JSON Editor**:

1. Pick a section in the sidebar (Settings, Styles, Custom Templates, Template Parts, Patterns).
2. Edit fields in the main panel.
3. The save bar appears when there are unsaved changes; click **Save** to persist via REST.

If the file changes externally between load and save, a conflict banner with a **Reload** action surfaces instead of overwriting silently.

Capabilities
------------

[](#capabilities)

ActionCapabilityExtra requirementView the editor`edit_themes`—Save changes`edit_themes``theme.json` writable on diskOnly roles with `edit_themes` (Administrator on a single site, Super Admin on multisite) see the **Appearance → Theme JSON Editor** menu and can hit the REST endpoints.

The editor is also disabled on production environments. The menu is hidden whenever `wp_get_environment_type()` returns `production`; the REST endpoints reject every request from those environments. Use it on `local`, `development`, or `staging`.

If the site sets `DISALLOW_FILE_EDIT` to `true` in `wp-config.php`, the editor will not be available. WordPress maps `edit_themes` to `do_not_allow` whenever that constant is on, which intentionally locks the plugin (and core's Theme/Plugin file editors) out.

Admin Colour Scheme
-------------------

[](#admin-colour-scheme)

Every accent colour in the editor (button background, link colour, list-active surface, badge background, focus ring, checkbox colour) is routed through `--wp-admin-theme-color` and its `-darker-10` shade exposed by `@wordpress/components`. Switching the user's admin colour scheme (Profile → Admin Color Scheme) changes the editor's accent automatically.

Surfaces (sidebar background, body text) stay neutral so they remain readable across all schemes.

REST API
--------

[](#rest-api)

All routes live under `wp-theme-json-editor/v1`. Auth follows the standard WordPress REST cookie + `X-WP-Nonce` flow.

### `GET /schema`

[](#get-schema)

Returns the official WordPress `theme.json` schema and the bundled core-scan snapshot of experimental + undocumented properties.

**Query**

- `version` *(string, default `auto`)* — pinned schema version (e.g. `6.7`, `trunk`) or `auto` to derive from `get_bloginfo('version')`.

**Caching**

The schema is fetched from `https://schemas.wp.org/wp/{version}/theme.json` once per 24 hours and stored in a transient. Network failures fall back to a bundled copy.

### `GET /document`

[](#get-document)

**Response**

```
{
  "data": { "...theme.json..." },
  "etag": "abcd1234…",
  "path": "wp-content/themes/twentytwentyfive/theme.json"
}
```

`etag` is `md5(filemtime+filesize)`.

### `POST /document`

[](#post-document)

**Body**

```
{
  "data": { "...theme.json..." },
  "etag": "abcd1234…"
}
```

Returns `200` with a fresh `etag` on success. Returns `409` with a `server_etag` and `server_data` payload when the etag has drifted (someone else edited the document between load and save) so the UI can render a conflict banner. Payloads larger than 1 MB are rejected with `413`.

Changelog
---------

[](#changelog)

A complete listing of all notable changes to this project are documented in [CHANGELOG.md](https://github.com/s3rgiosan/wp-theme-json-editor/blob/main/CHANGELOG.md).

License and Attribution
-----------------------

[](#license-and-attribution)

This project is licensed under the [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html). See the [LICENSE](LICENSE) file for details.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance88

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~37 days

Total

2

Last Release

40d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/42eed63db46bd6dc4df88e37095ad4f8aeacfcc63f68e7e11c637eb9ec18a652?d=identicon)[s3rgiosan](/maintainers/s3rgiosan)

---

Top Contributors

[![s3rgiosan](https://avatars.githubusercontent.com/u/499982?v=4)](https://github.com/s3rgiosan "s3rgiosan (2 commits)")

---

Tags

block-editorgutenbergwordpresswordpress-plugin

### Embed Badge

![Health badge](/badges/s3rgiosan-wp-theme-json-editor/health.svg)

```
[![Health](https://phpackages.com/badges/s3rgiosan-wp-theme-json-editor/health.svg)](https://phpackages.com/packages/s3rgiosan-wp-theme-json-editor)
```

###  Alternatives

[symfony/runtime

Enables decoupling PHP applications from global state

74298.8M1.1k](/packages/symfony-runtime)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5345.4M570](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2124.7M205](/packages/drupal-core-project-message)[sandersander/composer-link

Adds ability to link local packages for development with composer

98457.9k](/packages/sandersander-composer-link)[phpro/grumphp-shim

GrumPHP Phar distribution

294.7M342](/packages/phpro-grumphp-shim)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

43785.5k4](/packages/lullabot-drainpipe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
