LinkShortcode
in package
uses
UtilsProvider
Shortcode for:
- Link/Button to edit consent
- Link/Button to view history of consent
- Link/Button to revoke consent
There is also a UI shortcode builder: linkForm.tsx
Table of Contents
Constants
- ALLOWED_TAGS : mixed = [self::DEFAULT_TAG, 'button']
- ALLOWED_TYPES : mixed = ['history', 'revoke', 'change']
- BUTTON_CLICKED_IDENTIFIER : mixed = 'shortcode_revoke'
- DEFAULT_TAG : mixed = 'a'
- TAG : mixed = 'rcb-consent'
- TYPE_ALIASES : mixed = [ // es_* (Spanish) 'cambiar' => 'change', 'his...
- Known mistranslations of the technical `type` attribute values.
Methods
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- normalizeType() : string
- Normalize a shortcode `type` value to an allowed technical identifier.
- render() : string
- Render shortcode HTML and enqueue scripts and styles.
Constants
ALLOWED_TAGS
public
mixed
ALLOWED_TAGS
= [self::DEFAULT_TAG, 'button']
ALLOWED_TYPES
public
mixed
ALLOWED_TYPES
= ['history', 'revoke', 'change']
BUTTON_CLICKED_IDENTIFIER
public
mixed
BUTTON_CLICKED_IDENTIFIER
= 'shortcode_revoke'
DEFAULT_TAG
public
mixed
DEFAULT_TAG
= 'a'
TAG
public
mixed
TAG
= 'rcb-consent'
TYPE_ALIASES
Known mistranslations of the technical `type` attribute values.
public
mixed
TYPE_ALIASES
= [
// es_* (Spanish)
'cambiar' => 'change',
'historial' => 'history',
'revocar' => 'revoke',
]
Some locales translated the whole default shortcode string (including type="change"),
which breaks rendering. Map those back so already-stored cookie-policy copy keeps working.
Methods
getPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringnormalizeType()
Normalize a shortcode `type` value to an allowed technical identifier.
public
static normalizeType(string $type) : string
Parameters
- $type : string
Return values
stringrender()
Render shortcode HTML and enqueue scripts and styles.
public
static render(mixed $atts) : string
Parameters
- $atts : mixed