GCBGutenberg
Control Blocks
Buy

Field type

embed

A third-party widget — the snippet a provider gives you (Trustpilot, Calendly, Typeform, Elfsight…), pasted as it is. The render prints its markup and loads its <script src> when the host of that script is a known widget provider; any other script, inline code and HTML comments are dropped.

Type: embed · Stored attribute type: string

Stored value

string — the provider's snippet, markup and script tags as pasted

Supports

  • Monospace textarea the snippet is pasted into
  • A <script src> from a known widget host (the gcblite_embed_hosts filter) is enqueued in the footer once per page, its async / defer kept
  • The markup passes wp_kses: div, span, a, p, iframe (https only), img and blockquote, with class, id, style, href, src, sizes, title and any data-* attribute

Config options

OptionTypeDefaultDescription
rowsnumber8Height of the textarea, in rows.
helpTextstringOne-line description shown below the input. Defaults to a line on what to paste.

Gotchas

  • Inline <script> code never runs, and neither does a script from a host off the list — add a provider through the gcblite_embed_hosts filter.
  • Render it with gcblite_embed($attributes["key"] ?? null, $fallback) (gcb-lite includes/Render/embed.php), never by echoing the value.
  • The widget draws itself in the browser; the block editor's preview shows its markup only.

Example

JSON
{ "id": "ctrl_reviews",
  "type": "embed",
  "label": "Trustpilot widget",
  "attributeKey": "reviews",
  "parentPanelId": "panel" }

Consume

PHP

PHP
<?php
// render.php — the snippet's markup, its provider's script enqueued once
echo gcblite_embed($attributes['reviews'] ?? null);

Every field also takes the keys common to all fields.

Built from GCB Lite 0.4.0 (ce232d4). Source: schemas/controls/embed.md.

Copyright © 2026 Runchain. WordPress is a trademark of the WordPress Foundation.