Skip to main content

Configuration

WP Next Editor is built on top of WP Node and WP Next Admin, so its configuration inherits from both packages.

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.

Important: Do not change or delete these default configs. Modifying or removing the default post statuses, post types, or taxonomies will cause the editor to break or behave unexpectedly.

Post Status

File: src/_wp/config/post-status.json

StatusDescription
customAn 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 typeDescription
next-templateStores 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-colStores template collections — groups of templates used for Collection Nodes.
next-custom-codeStores Custom Code snippets (HTML/CSS/JS) that can be injected into template headers or footers via the Custom Code panel.
next-font-familyStores custom font family definitions. Each record represents a font family that can be selected in the editor's typography controls.
next-font-faceStores individual font face files (e.g. specific weights and styles) associated with a next-font-family record.
next-css-variablesStores 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

TaxonomyDescription
custom-codeTags 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-aliasAllows 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.

VariableDefaultDescription
MAX_PREVIEW_COUNT30Maximum 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_ENABLEDtrue (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_MINUTES3How 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_LOGdisabledSet 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.