WP Code & API Block: Changelog
2026
1.0.2
- Added a WordPress Shortcode language option to the code block, for displaying example
syntax (or any other plugin’s shortcode syntax) as a properly highlighted, copy-pasteable code sample. - Fixed: an example shortcode shown inside a code block could get picked up and actually executed by WordPress’s own
do_shortcode(), which runs over the entire rendered page after every block has already produced its output. The code block’s displayed brackets are now encoded as HTML entities at the character level — a browser still renders them as ordinary[/], and the Copy button still copies real, usable brackets — but WordPress’s shortcode parser can no longer misread them as a real invocation. No double-bracket escaping needed anymore. - Added an optional “Show a live rendered preview” toggle for the WordPress Shortcode language: runs the sample for real and shows its actual output in a separate labeled panel below the still-inert code sample, isolated so it can’t affect the surrounding page.
- Added
nahnu_code_block_render()(andnahnu_code_block_the()) so a theme or plugin developer can render any block directly from PHP — in a template, widget, or page-builder module — without needing it in post content or the block editor. - Added a
shortcode wrapping the same rendering path, for widgets, classic-editor content, and shortcode-only page builders. - Fixed: any block whose main attribute is a JSON array or list (Parameters, Response Body, Status Codes, Error Codes, Events, Servers, Request/Response, Endpoint’s related operations), plus the code block’s
codeattribute, now reads that value from the shortcode’s enclosed content instead of a quoted attribute — a quoted attribute can never safely hold a JSON array or code containing a quote character. - Fixed a much bigger issue affecting every
attribute on every block: the shortcode handler was normalizing attributes against a list that only ever containedblockand the seven color-override names, silently discarding every other attribute a block actually needed on every call. Also fixed WordPress’s automatic lowercasing of shortcode attribute names breaking every camelCase attribute (operationId,authRequired, etc.) independently of the first bug. - Added a Settings → Nahnu Code Block admin page: a color picker for each core theme color, in light and dark mode, applying site-wide to every block however it was placed.
- Added per-instance color overrides (
accentColor,accentTextColor,bgColor,chromeBgColor,textColor,borderColor,mutedColor) via shortcode attributes or a third argument tonahnu_code_block_render()/nahnu_code_block_the(). - Fixed: a block rendered via the new PHP API after
wp_head()has already printed now still gets its stylesheet, instead of rendering unstyled. - Documented the new PHP rendering API, shortcode, settings page, and per-instance branding in
INTEGRATION.mdandHOOKS.md. - Mobile responsiveness pass across all 12 blocks: tables now scroll horizontally within their own container instead of squeezing columns or breaking page layout; flex-row layouts (Try It console, Request/Response sub-tabs, Auth header line, Response Body toolbar) now wrap on narrow screens; the code block’s copy/theme-toggle toolbar and deep-link anchor icons are now always visible on touch devices instead of hover-only.
1.0.1
- Added six new blocks: Response Body, Error Codes, Events, API Navigation, and Servers.
- Parameters block: added Format and Default value badges, nested object parameter support, parameter location (
query/path/header/cookie/body), a Deprecated flag, and an Allowed-values (enum) field. - Added deep-linkable anchors (copy-link icon) on Parameters rows, Endpoint blocks, Error Codes, and Events.
- Added
nahnu_code_block_build_block_markup()for programmatic block generation (e.g. importing an OpenAPI spec), documented in the newINTEGRATION.md. - Added the
nahnu_code_block_pre_attributesfilter for third-party<pre>-scanning plugins. - Security: filter-derived theme CSS is now stripped of characters that could break out of its
<style>element, per a WordPress.org review finding. - Fixed the Copy button not scoping correctly when a block has multiple independent code panels open at once.
- Fixed two buttons (Auth and Request/Response) left referencing a removed CSS class, rendering unstyled.
- Fixed table titles on Parameters and Status Codes losing their styling after an earlier redesign.
- Corrected the Plugin URI, which pointed at a URL that didn’t resolve.
1.0.0
First public WP.org version.