Documentation

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'

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
codeCoverageIgnore

It only returns a string with the constant prefix

Return values
string

normalizeType()

Normalize a shortcode `type` value to an allowed technical identifier.

public static normalizeType(string $type) : string
Parameters
$type : string
Return values
string

render()

Render shortcode HTML and enqueue scripts and styles.

public static render(mixed $atts) : string
Parameters
$atts : mixed
Return values
string
On this page

Search results