Plugins

WordPress shortcode reference

Questa guida non è ancora stata tradotta nella Sua lingua.

The LegalCloud plugin registers two shortcodes: [legalcloud_doc] to show one document and [legalcloud_list] to list documents. This page is the reference for their arguments.

[legalcloud_doc]

The minimum shortcode needs the hash of the document; the language and the API token come from Settings → LegalCloud:

[legalcloud_doc hash="abc123def456"]

Arguments

ArgumentDefaultDescription
hash— (required)Public hash of the document: the part after /d/ of its public address
langdefault languageLanguage code: es, en, fr, de, it
height600Iframe height in pixels
modeiframeiframe embeds the document with the LegalCloud design. seo renders the HTML inside your page (better for SEO; inherits the design of your theme)
consent01 shows the document only after the visitor accepts cookies in the consent banner
tokentoken of the settingsUse a different token for this embed (for example a document token)

Examples

A specific document in English:

[legalcloud_doc hash="abc123def456" lang="en"]

The Spanish version of the same text (a different document, with its own hash):

[legalcloud_doc hash="def456abc789" lang="es"]

A taller iframe:

[legalcloud_doc hash="abc123def456" height="1000"]

Rendered inside the page, for SEO:

[legalcloud_doc hash="abc123def456" mode="seo"]

Only after consent:

[legalcloud_doc hash="abc123def456" consent="1"]

[legalcloud_list]

Prints a helper list of the documents of a site (title and the start of the hash). Clicking an entry copies its [legalcloud_doc] shortcode, so it is meant for editors preparing a page.

ArgumentDefaultDescription
siteauto (the site selected in the plugin)A site id
limit50Maximum number of documents
langdefault languageLanguage used in the copied shortcodes
[legalcloud_list limit="10" lang="en"]

Conditional rendering

Use WordPress conditional tags to show a different document in each context:

<?php
if (is_page('privacy')) {
    echo do_shortcode('[legalcloud_doc hash="abc123def456" lang="en"]');
} elseif (is_page('privacidad')) {
    echo do_shortcode('[legalcloud_doc hash="def456abc789" lang="es"]');
}
?>

Notices

When the document cannot be shown, the plugin prints a plain-text notice instead of mounting the iframe:

  • The document is assigned to other sites and this one is not allowed.
  • The visitor's country is not allowed by the document.
  • The token is missing or invalid (editors also see a hint to configure it).

The plugin checks the document policy (cached for five minutes) before rendering, and the iframe re-checks it live.

iframe or SEO mode

  • iframe (default): simplest and fastest; the document keeps the LegalCloud design.
  • seo: the document is part of your page's HTML, which is better for search engines and accessibility, but your page waits for the request to LegalCloud and inherits your theme's styles.

Next steps

Ultimo aggiornamento: 2026-10-27

Si registri GRATIS a vita, senza carta di credito

Crea un account gratuito