Adding a widget to Jalpi means editing source files in two stacks that share no code. There is no registration hook and no runtime API β a widget exists because the TypeScript registry declares it and the PHP side agrees.
There are two routes. The schema-driven route defines a widget entirely through a field list and touches four files; you write no React component and no PHP class. The bespoke route gives you full control of the markup and the inspector, at the cost of seven files that must all agree.
This page walks both, in order, with the exact file and function each step lands in. It ends with the failure modes β because almost every mistake here fails silently rather than throwing.
Choosing a Path#
Start with the schema-driven route. It is the default for anything the field vocabulary can express, and the registry's own comment lists what you inherit automatically: style, advanced, animation, responsive, global-styles, copy-paste, undo and import-export all operate on the node tree generically already.
| Your widget needs⦠| Route |
|---|---|
| A handful of text, number, colour, toggle, select, URL or icon fields | Schema |
| Markup driven entirely by those field values | Schema |
| A repeating list of simple items or objects | Schema β repeater / itemsRepeater |
| To hold other widgets as real children | Bespoke |
| A server-side query (posts, terms, products) | Bespoke |
| AJAX endpoints of its own | Bespoke |
| A hand-built inspector layout with conditional groups and popups | Bespoke |
| Markup that varies structurally, not just by value | Bespoke |
The existing split follows exactly this logic. Icon Box is schema-driven despite using the full icon-library picker, because its markup is a direct function of its fields. Products Grid is bespoke because it runs a live WC_Query and paginates over AJAX β neither of which a field schema can express.
Path A β A Schema-Driven Widget#
Four files, two of them required. The worked example below adds a Notice Bar widget: a dismissible coloured strip with an icon, a message and an optional link.
Step 1 β Add the type key#
In admin/editor/src/types/index.ts, add the type to the ElementType union. The registry-driven widgets are grouped together with a comment explaining the generic path; put yours alongside them.
export type ElementType =
| 'section'
// β¦
| 'shape-divider'
| 'notice-bar' // β new
| 'social-share'
// β¦Pick the type key carefully. It is written into every stored node, and changing it later orphans existing content β the sanitiser drops nodes whose type it does not recognise.
Step 2 β Add the registry entry#
In admin/editor/src/widgets/registry.ts, add a WidgetDef to one of the arrays β BATCH for effects-style widgets, SOCIAL for social ones, or a new array added to WIDGET_REGISTRY. Do not set bespoke. Its absence is what routes the widget through the generic path.
The entry supplies palette metadata, a seed node and the field list that generates the editor. See the first example below.
What each part controls:
| Key | Effect |
|---|---|
category | Which Elements-panel group and Block-picker tab it appears under |
label, icon, color, description | How it presents in the palette |
defaultNode | The node inserted when the widget is added |
fields | The controls generated in the inspector |
A category that is not already a hardcoded panel group automatically gets its own accordion, so a new category needs no edit to ElementsPanel.tsx.
Step 3 β Mirror the schema in PHP#
In includes/widgets-schema.php, add an entry to jalpi_widget_schemas(). This is the mirror the file's own docblock calls "the ONE intentional duplication between PHP and the TS editor", and it is not optional β without it the type is missing from jalpi_widget_schema_types(), so the sanitiser rejects it and the renderer never registers a handler.
The mirror carries only what the server needs:
renderβ which branch ofJalpi_Element_Generic::render_template()handles itneedsJsβ optional; enqueues the shared frontend scriptfieldsβ the field list with each field's control type, used to pick the right escaper
Declare each field as the PHP control matching its stored shape, not its editor control. A slider is declared number; a buttongroup is declared select; image is declared url; dimensions4, repeater and itemsRepeater are declared text.
Step 4 β Add the render branch#
In includes/elements/class-jalpi-element-generic.php, add a case to render_template() matching your schema's render key.
The contract for that branch:
- Return the widget's inner HTML only. The wrapper
<div class="jalpi-el jalpi-{id}">, the scoped CSS rule and the id and class attributes are built for you byrender(). - Escape everything.
sanitize_text_field()plusesc_html()for text,intval()with clamping for numbers, the privateenum()helper for constrained choices,Jalpi_Sanitizer::sanitize_color()for colours,esc_attr()for attributes,esc_url()for links. - Pass configuration to the browser as
data-*attributes, never inline<script>. - Make absent keys reproduce the previous output. Every existing branch does this so a newly added control cannot change how already-saved nodes render.
Step 5 β Add a canvas preview (optional)#
In admin/editor/src/widgets/GenericRenderer.tsx, add an entry to the PREVIEWS map keyed by your type.
This is genuinely optional. A widget with no entry falls back to a labelled placeholder that stays fully selectable, movable and stylable β the file's comment is explicit that the placeholder is only the visual preview, and the real frontend HTML comes from the PHP generic element either way.
Add one when the widget's appearance is what the author is editing. Skip it for anything whose output is inherently dynamic.
Step 6 β Add frontend behaviour (optional)#
If the widget needs JavaScript:
- Set
'needsJs' => truein the PHP schema.Jalpi_Element_Genericturns that into$renderer->set_needs_js( 'generic' ), which enqueues the shared script. - Add an initialiser to
assets/js/jalpi-frontend.jsand call it frominit().
Follow the file's established pattern: open with a selector guard so the function costs one failed query when the widget is absent, and read all configuration from data-* attributes.
function initNoticeBars() {
var els = document.querySelectorAll('.jalpi-notice-bar');
if (!els.length) return;
els.forEach(function (el) { /* β¦ */ });
}Step 7 β Build#
cd admin/editor
npm run lint # tsc --noEmit β catches the ElementType union mistakes
npm run build # or npm run start to watchPHP changes need no build step.
Files you never touch on this path: CanvasNode.tsx, PropertiesPanel.tsx, ElementsPanel.tsx, BlockPicker.tsx, class-jalpi-sanitizer.php and class-jalpi-renderer.php. Both dispatch switches in the editor already end in a default that routes schema widgets to GenericContent and GenericRenderer, and the renderer registers a Jalpi_Element_Generic instance per schema type automatically.
Path B β A Bespoke Widget#
Seven files must agree. Missing one is the usual cause of a widget that half-works, so treat the list as a checklist rather than a sequence.
The Seven Places#
| # | File | What to add |
|---|---|---|
| 1 | admin/editor/src/types/index.ts | The type key in the ElementType union |
| 2 | includes/elements/class-jalpi-element-{type}.php | A class extending Jalpi_Element |
| 3 | includes/class-jalpi-renderer.php | The class in register_elements()'s $element_classes array |
| 4 | includes/class-jalpi-sanitizer.php | The type in $allowed_types and a case in sanitize_content() |
| 5 | admin/editor/src/widgets/registry.ts | A b(...) entry β the helper stamps bespoke: true |
| 6 | admin/editor/src/components/canvas/CanvasNode.tsx | A case in renderContent() plus a renderer component |
| 7 | admin/editor/src/components/panels/PropertiesPanel.tsx | A case in ContentTab plus a *Content component |
Optionally an eighth: a *StyleTab component with an early return added to StyleTab's dispatcher, if the shared style panel is not enough.
The file naming in step 2 follows the autoloader convention exactly: Jalpi_Element_Notice_Bar resolves to includes/elements/class-jalpi-element-notice-bar.php. Get it wrong and the class silently fails to load.
Writing the Element Class#
The class implements two methods and follows the standard recipe covered on the Canvas Rendering page:
- Pull
id,content,styles,settingsoff the node. - Resolve dynamic tags on any text field via
$renderer->tags( $renderer->get_current_post_id() ). - Call
$renderer->get_css_attrs( $node )for the id and class attributes. - Build one scoped rule against
.jalpi-el.jalpi-{id}usingbg_data_to_css(),border_data_to_css()andstyles_to_css(), in that order, withstyles_to_css()last. - Add a
:hoverrule when the hover buckets produce anything. add_css()once.- Return exactly one root tag carrying
jalpi-el jalpi-{id},extra_clsandid_attr.
That last point is not stylistic. Both the CSS scoping and apply_interactions()'s regex injection depend on a single root tag.
Call $renderer->set_needs_js( '{flag}' ) only when the widget genuinely needs the script, and $renderer->render_children( $node ) if it holds children.
Two Edits in the Sanitiser#
Both are required and they fail differently:
- Missing from
$allowed_typesβ the whole node is dropped on save. The widget vanishes from the page. - Missing a
sanitize_content()case β the node survives but falls through tosanitize_generic_content(), which returns[]for a type with no schema entry. The widget stays on the page with empty content.
Write the case as a rebuild, not a filter: construct a new array containing only the keys you recognise, each through a type-appropriate sanitiser. Follow the existing cases β sanitize_text_field() for plain strings, wp_kses_post() for rich text, self::sanitize_url() for links, self::sanitize_color() for colours, self::sanitize_dimension() for measurements, self::sanitize_icon_value() for icons, intval() with min/max for bounded numbers, and in_array() for enumerated values.
The Two Editor Components#
The canvas renderer goes in CanvasNode.tsx as a component receiving node and inlineStyles, with a case added to renderContent(). It receives the fully resolved styles β presets, tokens, classes and the node's own literals already merged and breakpoint-aware β so apply inlineStyles to the element the frontend would style and add nothing else.
The content panel goes in PropertiesPanel.tsx as a *Content component receiving node and store, with a case added to ContentTab. Build it from the shared primitives β PropGroup, PropRow, TextInput, Select, Toggle, SliderPropRow, ColorPropRow, ItemRepeater β and write through store.updateNodeContent() or store.updateNode().
If the widget needs style controls beyond the shared panel, add a *StyleTab component and an early return in StyleTab's dispatcher, alongside the twenty that are already there.
Adding a New Style Property#
This applies to both paths and is the single most commonly missed step.
A widget-specific style key β the pattern used by iconSize, iconPadding, iconRotate, iconBoxColor and outerPadding* β lives in node.styles, and StyleMap's index signature means TypeScript accepts it without any declaration. But Jalpi_Sanitizer::sanitize_styles() is a strict allowlist, and a key it does not recognise is dropped on save with no error anywhere.
To add one, edit sanitize_styles():
| Kind of value | Where to add the key |
|---|---|
| A colour | The $color_keys array |
| A measurement | The $dim_keys array |
| Anything else | A new case in the switch, with its own validation |
Then, if the renderer should emit it as a plain CSS declaration, add it to the $map in Jalpi_Renderer::styles_to_css(). If your element class composes it into something else β as the icon and text-shadow keys do β add it to $composite_keys instead so the generic emitter skips it, and handle it in your own render().
The reverse mistake is just as easy: styles_to_css() already maps over ninety keys, so a property appearing in that map does not mean it can be stored. The sanitiser's allowlist is the authority.
Verification Checklist#
Work through this after either path. Each step catches a different silent failure.
npm run lintpasses β catches a type key missing from theElementTypeunion.- The widget appears in the Elements panel under the expected group β confirms the registry entry and its category.
- It appears in the command palette under
Ctrl/β + Kβ confirms it reachedBLOCKS. - Inserting it produces a node with the seed content from
defaultNode. - The inspector shows every control you declared, in the right tab β Content versus Style, per each field's
tab. - Editing a field updates the canvas β confirms the preview path.
- Save, then reload the editor. This is the critical one: it proves the sanitiser kept both the node and its content. Anything dropped at save time reappears as missing here.
- View the page on the frontend β confirms the element registration and the render branch.
- Check the page source for the widget's markup and its
.jalpi-{id}rule in the inline stylesheet. - If it needs JavaScript, confirm the script is enqueued and the initialiser runs. Remember the editor canvas never runs
jalpi-frontend.js, so interactive behaviour can only be verified on the real frontend. - Duplicate the widget and save β confirms nested child ids are being reassigned, if the
defaultNodeseeds children. - Test at tablet and mobile β confirms responsive overrides reach the right style map.
Common Failure Modes#
Almost everything here fails quietly. This table maps symptom to cause.
| Symptom | Likely cause |
|---|---|
| Widget missing from the Elements panel and command palette | No WIDGET_REGISTRY entry, or its category maps to null |
| Widget inserts, then disappears after save and reload | Type missing from the sanitiser's $allowed_types, or from jalpi_widget_schema_types() |
| Widget survives but its content is empty after reload | No sanitize_content() case, or fields not declared in widgets-schema.php |
| One field resets on every save | That field's key is missing from the PHP schema β the loop iterates the schema, not the content |
| A style control has no effect after reload | Its key is not in sanitize_styles()'s allowlist |
| Renders in the editor, blank on the frontend | Element class not registered in register_elements(), or no render branch matching the schema key |
| Renders on the frontend, placeholder on the canvas | No PREVIEWS entry β expected and harmless for a schema widget |
| Interactions and split text do nothing | The element returns more than one root tag |
| Content disappears when the widget is duplicated | Nested defaultNode child ids not reassigned β duplicate ids are dropped as a circular-reference guard |
| Class never loads, PHP fatal on the class name | File name does not match the autoloader convention |
| JavaScript never runs | needsJs not set, set_needs_js() not called, or the initialiser not added to init() |
Examples#
Step 1 β the type key#
admin/editor/src/types/index.ts. Add the key alongside the other registry-driven widgets.
export type ElementType =
| 'section'
| 'container'
| 'column'
// β¦ bespoke types β¦
// Registry-driven widgets (rendered via the generic path β see
// src/widgets/registry.ts, GenericRenderer.tsx, GenericContent.tsx and the
// PHP generic element/sanitizer default branches).
| 'marquee'
| 'typewriter-text'
| 'shape-divider'
| 'notice-bar' // β new
| 'social-share'
// β¦Step 2 β the registry entry#
admin/editor/src/widgets/registry.ts. No bespoke flag β its absence routes the widget through the generic path. Note the tab: 'style' fields and the showIf condition.
{
type: 'notice-bar', label: 'Notice Bar', icon: 'π’', category: 'Effects',
description: 'A dismissible banner with an icon, message and optional link.',
color: '#8b5cf6',
defaultNode: {
type: 'notice-bar',
content: {
message: 'We are running a limited-time offer.',
icon: { type: 'svg', lib: 'builtin', name: 'star' },
linkText: 'Learn more',
linkUrl: '',
dismissible: true,
bgColor: '#eef2ff',
textColor: '#1a1a1a',
},
styles: { fontSize: '15px' },
},
fields: [
{ key: 'message', label: 'Message', control: 'text' },
{ key: 'icon', label: 'Icon', control: 'icon' },
{ key: 'linkText', label: 'Link Text', control: 'text' },
{ key: 'linkUrl', label: 'Link URL', control: 'url',
placeholder: 'https://β¦', showIf: { key: 'linkText', truthy: true } },
{ key: 'dismissible', label: 'Dismissible', control: 'toggle' },
{ key: 'bgColor', label: 'Background', control: 'color',
group: 'Notice Style', tab: 'style' },
{ key: 'textColor', label: 'Text Color', control: 'color',
group: 'Notice Style', tab: 'style' },
],
}Step 3 β the PHP mirror#
includes/widgets-schema.php. Required, not optional β without it the sanitiser rejects the type entirely. Declare each field as the PHP control matching its stored shape.
'notice-bar' => [
'render' => 'notice-bar',
'needsJs' => true, // the dismiss button needs a listener
'fields' => [
'message' => 'text',
'icon' => 'icon', // sanitized via sanitize_icon_value()
'linkText' => 'text',
'linkUrl' => 'url',
'dismissible' => 'toggle',
'bgColor' => 'color',
'textColor' => 'color',
],
],Step 4 β the render branch#
includes/elements/class-jalpi-element-generic.php, inside render_template(). Return inner HTML only; the wrapper and scoped CSS are built by render(). Every value is escaped, and absent keys reproduce the previous output.
case 'notice-bar': {
$message = sanitize_text_field( $content['message'] ?? '' );
if ( '' === $message ) {
return '';
}
$bg = Jalpi_Sanitizer::sanitize_color( $content['bgColor'] ?? '' );
$fg = Jalpi_Sanitizer::sanitize_color( $content['textColor'] ?? '' );
$dism = ! empty( $content['dismissible'] ) ? '1' : '0';
$style = '';
if ( $bg ) { $style .= 'background:' . esc_attr( $bg ) . ';'; }
if ( $fg ) { $style .= 'color:' . esc_attr( $fg ) . ';'; }
// Icon β reuse the shared helper so CDN icon libraries are tracked.
$icon_html = ! empty( $content['icon'] )
? $renderer->render_icon_value( $content['icon'] )
: '';
// Optional link
$link_html = '';
$link_text = sanitize_text_field( $content['linkText'] ?? '' );
$link_url = esc_url( $content['linkUrl'] ?? '' );
if ( $link_text && $link_url ) {
$link_html = '<a class="jalpi-notice-bar__link" href="' . $link_url . '">'
. esc_html( $link_text ) . '</a>';
}
$close_html = '1' === $dism
? '<button type="button" class="jalpi-notice-bar__close" aria-label="'
. esc_attr__( 'Dismiss', 'jalpi-page-builder' ) . '">×</button>'
: '';
return '<div class="jalpi-notice-bar" data-dismissible="' . esc_attr( $dism ) . '"'
. ( $style ? ' style="' . esc_attr( $style ) . '"' : '' ) . '>'
. $icon_html
. '<span class="jalpi-notice-bar__msg">' . esc_html( $message ) . '</span>'
. $link_html
. $close_html
. '</div>';
}Step 5 β the canvas preview (optional)#
admin/editor/src/widgets/GenericRenderer.tsx, added to the PREVIEWS map. Omitting this leaves a labelled placeholder that is still fully selectable and stylable.
const PREVIEWS: Record<string, (c: Record<string, unknown>) => React.ReactNode> = {
// β¦ existing entries β¦
'notice-bar': (c) => (
<div
style={{
display: 'flex', alignItems: 'center', gap: 10,
padding: '10px 14px', borderRadius: 6,
background: str(c.bgColor, '#eef2ff'),
color: str(c.textColor, '#1a1a1a'),
}}
>
{c.icon ? <RenderIconValue value={c.icon as IconValue} /> : null}
<span style={{ flex: 1 }}>{str(c.message, 'Notice messageβ¦')}</span>
{str(c.linkText) ? <span style={{ textDecoration: 'underline' }}>{str(c.linkText)}</span> : null}
{c.dismissible ? <span style={{ opacity: 0.5 }}>Γ</span> : null}
</div>
),
};Path B β a bespoke element class#
includes/elements/class-jalpi-element-notice-bar.php. The standard recipe: resolve tags, get attrs, build one scoped rule, add_css once, return one root tag.
<?php
defined( 'ABSPATH' ) || exit;
class Jalpi_Element_Notice_Bar extends Jalpi_Element {
public static function type(): string { return 'notice-bar'; }
public function render( array $node, Jalpi_Renderer $renderer ): string {
$id = sanitize_html_class( $node['id'] ?? '' );
$content = $node['content'] ?? [];
$styles = $node['styles'] ?? [];
$settings = $node['settings'] ?? [];
$message = wp_kses_post(
$renderer->tags( $renderer->get_current_post_id() )->resolve( $content['message'] ?? '' )
);
$a = $renderer->get_css_attrs( $node );
$sel = '.jalpi-el.jalpi-' . $id;
$css = "{$sel}{display:flex;align-items:center;gap:10px;box-sizing:border-box;";
$css .= $renderer->bg_data_to_css( $settings['bgNormal'] ?? [] );
$css .= $renderer->border_data_to_css( $settings['borderNormal'] ?? [] );
$css .= $renderer->styles_to_css( $styles );
$css .= '}';
$hover = $renderer->bg_data_to_css( $settings['bgHover'] ?? [] )
. $renderer->border_data_to_css( $settings['borderHover'] ?? [] );
if ( $hover ) {
$css .= "{$sel}:hover{{$hover}}";
}
$renderer->add_css( $css );
if ( ! empty( $content['dismissible'] ) ) {
$renderer->set_needs_js( 'generic' );
}
// Exactly one root tag β required by CSS scoping and apply_interactions().
return '<div class="jalpi-el jalpi-' . esc_attr( $id ) . $a['extra_cls'] . '"' . $a['id_attr'] . '>'
. '<span class="jalpi-notice-bar__msg">' . $message . '</span>'
. '</div>';
}
}Path B β the two sanitiser edits#
includes/class-jalpi-sanitizer.php. Both are required, and they fail differently β see the failure-modes table.
// 1. sanitize_node() β add the type to $allowed_types
$allowed_types = [
'section', 'container', 'column',
// β¦
'countdown', 'flip-box', 'star-rating',
'notice-bar', // β new
'products-grid', 'product-categories', 'single-product',
];
// 2. sanitize_content() β add a case that REBUILDS the content array
case 'notice-bar':
return [
'message' => sanitize_text_field( $content['message'] ?? '' ),
'icon' => self::sanitize_icon_value( $content['icon'] ?? '', '' ),
'linkText' => sanitize_text_field( $content['linkText'] ?? '' ),
'linkUrl' => self::sanitize_url( $content['linkUrl'] ?? '' ),
'dismissible' => (bool) ( $content['dismissible'] ?? false ),
'bgColor' => self::sanitize_color( $content['bgColor'] ?? '' ),
'textColor' => self::sanitize_color( $content['textColor'] ?? '' ),
];Path B β registering the element#
includes/class-jalpi-renderer.php, in register_elements(). Add before the generic loop β the guard there already refuses to shadow a bespoke type, but the explicit list is where a bespoke widget belongs.
private function register_elements(): void {
$element_classes = [
Jalpi_Element_Section::class,
Jalpi_Element_Container::class,
// β¦
Jalpi_Element_Star_Rating::class,
Jalpi_Element_Notice_Bar::class, // β new
Jalpi_Element_Products_Grid::class,
// β¦
];
foreach ( $element_classes as $class ) {
$el = new $class();
$this->elements[ $class::type() ] = $el;
}
// β¦ generic registration for schema types follows β¦
}Notes#
- Prefer the schema-driven path. It touches four files instead of seven, and the widget inherits style, advanced, animation, responsive, global-styles, copy-paste, undo and import-export automatically because those all operate on the node tree generically.
- A schema-driven widget requires no edits to
CanvasNode.tsx,PropertiesPanel.tsx,ElementsPanel.tsx,BlockPicker.tsx, the sanitiser or the renderer. Both editor dispatch switches end in adefaultthat routes schema widgets to the generic components, and the renderer registers aJalpi_Element_Genericinstance per schema type. - A new palette
categoryneeds no code change. The Elements panel auto-groups any registry widget that its hardcoded lists do not place, creating a new accordion for an unrecognised category. - Element class file names follow the autoloader convention strictly:
Jalpi_Element_Notice_Barβincludes/elements/class-jalpi-element-notice-bar.php. Strip theJalpi_prefix, lowercase, replace underscores with hyphens, prefix withclass-jalpi-. - The canvas renderer receives
inlineStylesfully resolved β presets, tokens, attached classes and the node's own literals already merged, and already breakpoint-aware. Apply it to the element the frontend would style and add nothing else. - In a generic render branch, return the widget's inner HTML only. The
<div class="jalpi-el jalpi-{id}">wrapper, the scoped CSS rule and the id and class attributes are all built byJalpi_Element_Generic::render(). - Write every render branch so that absent content keys reproduce the previous output exactly. Every existing branch does this, which is what lets new controls ship without changing how already-saved nodes render.
- Run
npm run lintbefore building.tsc --noEmitcatches a type key missing from theElementTypeunion, which is otherwise a silent mismatch between the registry and the type system.
Warnings#
- Skipping the
widgets-schema.phpmirror is fatal, not cosmetic. Without it the type is absent fromjalpi_widget_schema_types(), so the sanitiser's allowed-type list rejects it and the whole node is dropped on the first save β the widget disappears from the page entirely. - A field declared in
registry.tsbut not in the PHP mirror is discarded on every save.sanitize_generic_content()iterates the schema, not the incoming content, so an undeclared key is never copied no matter what the editor stored. - A new style property must be added to
Jalpi_Sanitizer::sanitize_styles()β to$color_keys,$dim_keys, or a newcase. It is a strict allowlist, and an unrecognised key is dropped on save with no error in the editor, the log or the response. Jalpi_Renderer::styles_to_css()maps over ninety keys, but that map does not govern what can be stored. A property present there and absent from the sanitiser's allowlist will never reach the renderer at all.- An element's
render()must return exactly one root tag. Returning a fragment breaks the.jalpi-el.jalpi-{id}CSS scoping and silently disables interactions and split text, sinceapply_interactions()injects its payload into the first opening tag it finds. - Do not change a type key after content has been saved with it. The sanitiser drops nodes whose type it does not recognise, so a rename orphans every existing instance on the next save.
- If a
defaultNodeseedschildren, its placeholder ids are literal in the registry. They must be reassigned at insertion time βwithFreshChildIds()handles the built-in cases β or two instances on one page will share ids and the server will drop the duplicates. - The editor canvas does not run
jalpi-frontend.js. Any behaviour you add there can only be verified on the real frontend, never on the canvas. - Widget labels and descriptions in
registry.tsare plain string literals with no translation wrapper, unlike PHP-side strings. Text you emit from an element class should still use__()andesc_html__().
Source Files#
admin/editor/src/types/index.tsadmin/editor/src/widgets/registry.tsadmin/editor/src/widgets/GenericContent.tsxadmin/editor/src/widgets/GenericRenderer.tsxadmin/editor/src/components/canvas/CanvasNode.tsxadmin/editor/src/components/canvas/BlockPicker.tsxadmin/editor/src/components/panels/ElementsPanel.tsxadmin/editor/src/components/panels/PropertiesPanel.tsxadmin/editor/src/components/panels/IconPickerModal.tsxadmin/editor/src/store/editorStore.tsadmin/editor/package.jsonincludes/widgets-schema.phpincludes/class-jalpi-element.phpincludes/elements/class-jalpi-element-generic.phpincludes/elements/class-jalpi-element-heading.phpincludes/elements/class-jalpi-element-countdown.phpincludes/class-jalpi-renderer.phpincludes/class-jalpi-sanitizer.phpassets/js/jalpi-frontend.js
Related#
- Widget Registry
- Widgets
- Canvas Rendering
- Data Structure
- Editor Controls
- The Editor
- Architecture Overview
- API Reference
Last updated: November 2026