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
| Argument | Default | Description |
|---|---|---|
hash | — (required) | Public hash of the document: the part after /d/ of its public address |
lang | default language | Language code: es, en, fr, de, it |
height | 600 | Iframe height in pixels |
mode | iframe | iframe embeds the document with the LegalCloud design. seo renders the HTML inside your page (better for SEO; inherits the design of your theme) |
consent | 0 | 1 shows the document only after the visitor accepts cookies in the consent banner |
token | token of the settings | Use 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.
| Argument | Default | Description |
|---|---|---|
site | auto (the site selected in the plugin) | A site id |
limit | 50 | Maximum number of documents |
lang | default language | Language 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.