Documentation

Banner
in package
Uses UtilsProvider

Main banner.

Table of Contents

Constants

ACTION_CLEAR_CURRENT_COOKIE  = 'rcb-clear-current-cookie'
DESIGN_VERSION  = 9
The design version is incremented each time, we need to distinguish between some UI elements within our cookie banner and content blockers. For example, in a recent version of Real Cookie Banner we removed the footer for content blockers completely, but to be compliant with our documentation we still want to show footers for older consents in our "List of consents".
HTML_ATTRIBUTE_UNIQUE_WRITE_NAME  = 'unique-write-name'
Example:

Properties

$customize  : BannerCustomize
The customize handler

Methods

admin_bar_menu()  : mixed
Show a "Show banner again" button in the admin toolbar in frontend.
getCustomize()  : mixed
Getter.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
instance()  : mixed
New instance.
isHiddenDueLegal()  : mixed
Checks if the overlay should be hidden due to legal setting. E. g. hide cookie banner on legal notice page.
isPreventPreDecision()  : mixed
Determine if the current page should not handle a predecision.
shouldLoadAssets()  : mixed
Checks if the banner is active for the current page. This does not check any user relevant conditions because they need to be done in frontend (caching).
wp_body_open()  : mixed
Print out the overlay at `wp_body_open`. See also `wp_footer` for backwards-compatibilty.
wp_footer()  : mixed
Print out the overlay at `wp_footer` time but only when `wp_body_open` was not yet called (some themes do not support it).
wp_head()  : mixed
The `codeOnPageLoad` can be directly rendered to the Output Buffer cause it does not stand in conflict with any caching plugin (no conditional rendering).
poweredLink()  : mixed
Get the "Powered by" link.
printOverlay()  : mixed
Print out the overlay so it is server-side rendered (avoid flickering as early as possible).
__construct()  : mixed
C'tor.

Constants

public mixed ACTION_CLEAR_CURRENT_COOKIE = 'rcb-clear-current-cookie'

DESIGN_VERSION

The design version is incremented each time, we need to distinguish between some UI elements within our cookie banner and content blockers. For example, in a recent version of Real Cookie Banner we removed the footer for content blockers completely, but to be compliant with our documentation we still want to show footers for older consents in our "List of consents".

public mixed DESIGN_VERSION = 9

For the chronically changes have a look at the @devowl-wp/react-cookie-banner package.

HTML_ATTRIBUTE_UNIQUE_WRITE_NAME

Example:

public mixed HTML_ATTRIBUTE_UNIQUE_WRITE_NAME = 'unique-write-name'
<script unique-write-name="gtag">console.log("this gets written to DOM");</script>
<script unique-write-name="gtag">console.log("this gets skipped");</script>

Properties

Methods

admin_bar_menu()

Show a "Show banner again" button in the admin toolbar in frontend.

public admin_bar_menu(WP_Admin_Bar $admin_bar) : mixed
Parameters
$admin_bar : WP_Admin_Bar

getCustomize()

Getter.

public getCustomize() : mixed
Tags
codeCoverageIgnore

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

instance()

New instance.

public static instance() : mixed
Tags
codeCoverageIgnore

isHiddenDueLegal()

Checks if the overlay should be hidden due to legal setting. E. g. hide cookie banner on legal notice page.

public isHiddenDueLegal() : mixed

isPreventPreDecision()

Determine if the current page should not handle a predecision.

public isPreventPreDecision() : mixed

See also useBannerPreDecisionGateway.tsx.

shouldLoadAssets()

Checks if the banner is active for the current page. This does not check any user relevant conditions because they need to be done in frontend (caching).

public shouldLoadAssets(string $context) : mixed
Parameters
$context : string

The context passed to Assets#enqueue_script_and_styles

Tags
see
https://app.clickup.com/t/5yty88

wp_body_open()

Print out the overlay at `wp_body_open`. See also `wp_footer` for backwards-compatibilty.

public wp_body_open() : mixed

Print out the overlay at `wp_footer` time but only when `wp_body_open` was not yet called (some themes do not support it).

public wp_footer() : mixed

wp_head()

The `codeOnPageLoad` can be directly rendered to the Output Buffer cause it does not stand in conflict with any caching plugin (no conditional rendering).

public wp_head() : mixed

Get the "Powered by" link.

protected poweredLink() : mixed

printOverlay()

Print out the overlay so it is server-side rendered (avoid flickering as early as possible).

protected printOverlay() : mixed

See also inlineStyle.tsx#overlay for more information!

__construct()

C'tor.

private __construct() : mixed

        
On this page

Search results