Configuration
WP Next Editor is built on top of WP Node and WP Next Admin, so its configuration inherits from both packages.
- WP Node configuration: https://rnaga.github.io/wp-node/docs/getting-started/configuration
- WP Next Admin configuration: https://rnaga.github.io/wp-next/docs/getting-started/configuration
Editor-specific configuration is described below.
Post Status, Post Types, and Taxonomies
When installed via the CLI (npx @rnaga/wp-next-cli -- initEditor), the editor registers its own custom post statuses, post types, and taxonomies with WordPress. These are defined in JSON files under src/_wp/config/ in your project.
Post Status
File: src/_wp/config/post-status.json
| Status | Description |
|---|---|
custom | An internal post status used for editor-managed posts that are not yet in a standard WordPress lifecycle state (draft, publish, etc.). Marked internal: true so it is not exposed in the WordPress admin UI. |
Post Types
File: src/_wp/config/post-type.json
| Post type | Description |
|---|---|
next-template | Stores page templates. Each record's post_content field holds the Lexical JSON for that template. This is the primary content type of the editor. |
next-template-col | Stores template collections — groups of templates used for Collection Nodes. |
next-custom-code | Stores Custom Code snippets (HTML/CSS/JS) that can be injected into template headers or footers via the Custom Code panel. |
next-font-family | Stores custom font family definitions. Each record represents a font family that can be selected in the editor's typography controls. |
next-font-face | Stores individual font face files (e.g. specific weights and styles) associated with a next-font-family record. |
next-css-variables | Stores named CSS variable collections. Each record holds a set of typed CSS custom properties that can be assigned to node styles across templates. |
Taxonomies
File: src/_wp/config/taxonomy.json
| Taxonomy | Description |
|---|---|
custom-code | Tags next-custom-code posts so they can be referenced by name from within templates. A template's Custom Code node references slugs from this taxonomy to determine which code snippets to inject. |
page-slug-alias | Allows a template to be served at additional URL slugs beyond its primary slug. Attach one or more alias terms to a next-template post to make it accessible at those paths. |
Environment Variables
The following environment variables can be set in your project's .env file to control editor-specific behavior.
| Variable | Default | Description |
|---|---|---|
MAX_PREVIEW_COUNT | 30 | Maximum number of preview versions stored per template. When the limit is exceeded, older previews are automatically deleted. Increase this if you need a longer revision history. |
WP_NEXT_EDITOR_SLUG_CACHE_ENABLED | true (enabled) | Controls whether the published slug lookup is cached via Next.js unstable_cache. Set to "false" to disable caching — useful during development when templates are being published and unpublished frequently. |
WP_NEXT_EDITOR_SLUG_CACHE_TTL_MINUTES | 3 | How long (in minutes) the slug cache lives before Next.js revalidates it in the background. Only effective when WP_NEXT_EDITOR_SLUG_CACHE_ENABLED is enabled. |
WP_ENABLE_LOG | disabled | Set to "true" to enable server-side logging. Logs include an ISO timestamp prefix and are routed to stdout (info/debug) or stderr (warn/error). |
WP_LOG_LEVEL | "error" | Minimum log level to emit when logging is enabled. Levels in ascending order: debug < info < warn < error. Messages below the configured level are silently dropped. |