Documentation

General extends AbstractGeneral
in package
implements IOverrideGeneral uses General, UtilsProvider

General settings.

Table of Contents

Interfaces

IOverrideGeneral

Constants

DEFAULT_BANNER_ACTIVE  : mixed = false
DEFAULT_BLOCKER_ACTIVE  : mixed = true
DEFAULT_COOKIE_POLICY_ID  : mixed = 0
DEFAULT_HIDE_PAGE_IDS  : mixed = ''
DEFAULT_OPERATOR_CONTACT_ADDRESS  : mixed = ''
DEFAULT_OPERATOR_CONTACT_EMAIL  : mixed = ''
DEFAULT_OPERATOR_CONTACT_FORM_ID  : mixed = 0
DEFAULT_OPERATOR_CONTACT_PHONE  : mixed = ''
DEFAULT_SET_COOKIES_VIA_MANAGER  : mixed = 'none'
LEGAL_BASIS_ALLOWED  : mixed = [self::TERRITORIAL_LEGAL_BASIS_GDPR, self::TERR...
OPTION_GROUP  : mixed = 'options'
SETTING_BANNER_ACTIVE  : mixed = RCB_OPT_PREFIX . '-banner-active'
SETTING_BLOCKER_ACTIVE  : mixed = RCB_OPT_PREFIX . '-blocker-active'
SETTING_COOKIE_POLICY_ID  : mixed = RCB_OPT_PREFIX . '-cookie-policy-id'
SETTING_HIDE_PAGE_IDS  : mixed = RCB_OPT_PREFIX . '-hide-page-ids'
SETTING_OPERATOR_CONTACT_ADDRESS  : mixed = RCB_OPT_PREFIX . '-operator-contact-address'
SETTING_OPERATOR_CONTACT_EMAIL  : mixed = RCB_OPT_PREFIX . '-operator-contact-email'
SETTING_OPERATOR_CONTACT_FORM_ID  : mixed = RCB_OPT_PREFIX . '-operator-contact-form-id'
SETTING_OPERATOR_CONTACT_PHONE  : mixed = RCB_OPT_PREFIX . '-operator-contact-phone'
SETTING_OPERATOR_COUNTRY  : mixed = RCB_OPT_PREFIX . '-operator-country'
SETTING_SET_COOKIES_VIA_MANAGER  : mixed = RCB_OPT_PREFIX . '-set-cookies-via-manager'
SETTING_TERRITORIAL_LEGAL_BASIS  : mixed = RCB_OPT_PREFIX . '-territorial-legal-basis'
TERRITORIAL_LEGAL_BASIS_DSG_SWITZERLAND  : mixed = 'dsg-switzerland'
TERRITORIAL_LEGAL_BASIS_GDPR  : mixed = 'gdpr-eprivacy'

Properties

$me  : General
Singleton instance.

Methods

before_delete_post()  : mixed
When a page gets deleted, check if the value is our configured contact form page and reset the value accordingly.
enableOptionsAutoload()  : mixed
Initially `add_option` to avoid autoloading issues.
getAdditionalPageHideIds()  : mixed
getBannerLinks()  : array<string|int, BannerLink>
Get the list of banner links which should be shown in cookie banner and content blocker.
getBlocker()  : array<string|int, Blocker>
Get the list of content blockers.
getCookiePolicyId()  : int
Get the cookie policy page ID.
getCookiePolicyUrl()  : mixed
Get the cookie policy page URL.
getDefaultOperatorContactEmail()  : mixed
Get default operator contact email.
getDefaultOperatorCountry()  : mixed
Get default operator country. We try to calculate the country from the blog language.
getDefaultPrivacyPolicy()  : mixed
Get default privacy policy post ID.
getDefaultTerritorialLegalBasis()  : mixed
Get default territorial legal basis.
getEssentialServiceGroup()  : mixed
Get the essential service groups.
getInstance()  : General
Get singleton instance.
getLanguages()  : array<string|int, Language>
Get the list of languages in which this website is reachable. This is also used for the language switcher.
getNonDefaultServiceGroups()  : array<string|int, ServiceGroup>
Get the list of service groups and their services which are not created by default (custom groups).
getOperatorContactAddress()  : string
Get configured operator contact address.
getOperatorContactEmail()  : string
Get configured operator contact email.
getOperatorContactFormId()  : int
Get the operator contact form page ID.
getOperatorContactFormUrl()  : mixed
Get the operator contact form page URL.
getOperatorContactPhone()  : string
Get configured operator contact phone.
getOperatorCountry()  : string
Get configured operator country.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
getServiceGroups()  : array<string|int, ServiceGroup>
Get the list of service groups and their services.
getSetCookiesViaManager()  : mixed
getSettings()  : mixed
Getter.
getTerritorialLegalBasis()  : array<string|int, string>
Get configured legal basis.
isBannerActive()  : bool
Is the banner active?
isBlockerActive()  : bool
Is the content blocker active?
overrideEnableOptionsAutoload()  : mixed
overrideRegister()  : mixed
register()  : mixed
Register settings.
sanitize_delimited_list()  : mixed
Sanitize a delimiter-separated list option that pre-dates WP 5.3's native array option type (e.g. CSV of page IDs / country codes, pipe-separated forward-to URLs). Splits `$value` on `$delimiter`, applies `$itemSanitizer` to each raw token, drops tokens that become empty after sanitization and rejoins with the same delimiter.
sanitize_operator_country()  : mixed
Sanitize operator country option for persistence and REST.
sanitize_set_cookies_via_manager()  : mixed
Sanitize tag manager integration mode option.
sanitize_territorial_legal_basis()  : mixed
Sanitize territorial legal basis list stored as a comma-separated string.
setSettings()  : mixed
Setter.
__construct()  : mixed
C'tor.

Constants

DEFAULT_BANNER_ACTIVE

public mixed DEFAULT_BANNER_ACTIVE = false

DEFAULT_BLOCKER_ACTIVE

public mixed DEFAULT_BLOCKER_ACTIVE = true
public mixed DEFAULT_COOKIE_POLICY_ID = 0

DEFAULT_HIDE_PAGE_IDS

public mixed DEFAULT_HIDE_PAGE_IDS = ''

DEFAULT_OPERATOR_CONTACT_ADDRESS

public mixed DEFAULT_OPERATOR_CONTACT_ADDRESS = ''

DEFAULT_OPERATOR_CONTACT_EMAIL

public mixed DEFAULT_OPERATOR_CONTACT_EMAIL = ''

DEFAULT_OPERATOR_CONTACT_FORM_ID

public mixed DEFAULT_OPERATOR_CONTACT_FORM_ID = 0

DEFAULT_OPERATOR_CONTACT_PHONE

public mixed DEFAULT_OPERATOR_CONTACT_PHONE = ''

DEFAULT_SET_COOKIES_VIA_MANAGER

public mixed DEFAULT_SET_COOKIES_VIA_MANAGER = 'none'
public mixed LEGAL_BASIS_ALLOWED = [self::TERRITORIAL_LEGAL_BASIS_GDPR, self::TERRITORIAL_LEGAL_BASIS_DSG_SWITZERLAND]

OPTION_GROUP

public mixed OPTION_GROUP = 'options'

SETTING_BANNER_ACTIVE

public mixed SETTING_BANNER_ACTIVE = RCB_OPT_PREFIX . '-banner-active'

SETTING_BLOCKER_ACTIVE

public mixed SETTING_BLOCKER_ACTIVE = RCB_OPT_PREFIX . '-blocker-active'
public mixed SETTING_COOKIE_POLICY_ID = RCB_OPT_PREFIX . '-cookie-policy-id'

SETTING_HIDE_PAGE_IDS

public mixed SETTING_HIDE_PAGE_IDS = RCB_OPT_PREFIX . '-hide-page-ids'

SETTING_OPERATOR_CONTACT_ADDRESS

public mixed SETTING_OPERATOR_CONTACT_ADDRESS = RCB_OPT_PREFIX . '-operator-contact-address'

SETTING_OPERATOR_CONTACT_EMAIL

public mixed SETTING_OPERATOR_CONTACT_EMAIL = RCB_OPT_PREFIX . '-operator-contact-email'

SETTING_OPERATOR_CONTACT_FORM_ID

public mixed SETTING_OPERATOR_CONTACT_FORM_ID = RCB_OPT_PREFIX . '-operator-contact-form-id'

SETTING_OPERATOR_CONTACT_PHONE

public mixed SETTING_OPERATOR_CONTACT_PHONE = RCB_OPT_PREFIX . '-operator-contact-phone'

SETTING_OPERATOR_COUNTRY

public mixed SETTING_OPERATOR_COUNTRY = RCB_OPT_PREFIX . '-operator-country'

SETTING_SET_COOKIES_VIA_MANAGER

public mixed SETTING_SET_COOKIES_VIA_MANAGER = RCB_OPT_PREFIX . '-set-cookies-via-manager'
public mixed SETTING_TERRITORIAL_LEGAL_BASIS = RCB_OPT_PREFIX . '-territorial-legal-basis'
public mixed TERRITORIAL_LEGAL_BASIS_DSG_SWITZERLAND = 'dsg-switzerland'
public mixed TERRITORIAL_LEGAL_BASIS_GDPR = 'gdpr-eprivacy'

Properties

Methods

before_delete_post()

When a page gets deleted, check if the value is our configured contact form page and reset the value accordingly.

public before_delete_post(number $postId) : mixed

Why using before_delete_post instead of delete_post? We are deleting also translations in PolyLang/WPML and we need to do this before the deletion process is done.

Parameters
$postId : number

enableOptionsAutoload()

Initially `add_option` to avoid autoloading issues.

public enableOptionsAutoload() : mixed

getAdditionalPageHideIds()

public getAdditionalPageHideIds() : mixed

Get the list of banner links which should be shown in cookie banner and content blocker.

public getBannerLinks() : array<string|int, BannerLink>
Return values
array<string|int, BannerLink>

getBlocker()

Get the list of content blockers.

public getBlocker() : array<string|int, Blocker>
Return values
array<string|int, Blocker>

getCookiePolicyId()

Get the cookie policy page ID.

public getCookiePolicyId() : int
Return values
int

getCookiePolicyUrl()

Get the cookie policy page URL.

public getCookiePolicyUrl([mixed $default = false ]) : mixed
Parameters
$default : mixed = false

getDefaultOperatorContactEmail()

Get default operator contact email.

public getDefaultOperatorContactEmail() : mixed

getDefaultOperatorCountry()

Get default operator country. We try to calculate the country from the blog language.

public getDefaultOperatorCountry() : mixed

getDefaultPrivacyPolicy()

Get default privacy policy post ID.

public getDefaultPrivacyPolicy() : mixed

getDefaultTerritorialLegalBasis()

Get default territorial legal basis.

public getDefaultTerritorialLegalBasis() : mixed

getEssentialServiceGroup()

Get the essential service groups.

public getEssentialServiceGroup() : mixed

getInstance()

Get singleton instance.

public static getInstance() : General
Tags
codeCoverageIgnore
Return values
General

getLanguages()

Get the list of languages in which this website is reachable. This is also used for the language switcher.

public getLanguages() : array<string|int, Language>
Return values
array<string|int, Language>

getNonDefaultServiceGroups()

Get the list of service groups and their services which are not created by default (custom groups).

public getNonDefaultServiceGroups() : array<string|int, ServiceGroup>
Return values
array<string|int, ServiceGroup>

getOperatorContactAddress()

Get configured operator contact address.

public getOperatorContactAddress() : string
Return values
string

getOperatorContactEmail()

Get configured operator contact email.

public getOperatorContactEmail() : string
Return values
string

getOperatorContactFormId()

Get the operator contact form page ID.

public getOperatorContactFormId() : int
Return values
int

getOperatorContactFormUrl()

Get the operator contact form page URL.

public getOperatorContactFormUrl([mixed $default = false ]) : mixed
Parameters
$default : mixed = false

getOperatorContactPhone()

Get configured operator contact phone.

public getOperatorContactPhone() : string
Return values
string

getOperatorCountry()

Get configured operator country.

public getOperatorCountry() : string
Return values
string

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

getServiceGroups()

Get the list of service groups and their services.

public getServiceGroups() : array<string|int, ServiceGroup>
Return values
array<string|int, ServiceGroup>

getSetCookiesViaManager()

public getSetCookiesViaManager() : mixed

getSettings()

Getter.

public getSettings() : mixed
Tags
codeCoverageIgnore

getTerritorialLegalBasis()

Get configured legal basis.

public getTerritorialLegalBasis() : array<string|int, string>
Return values
array<string|int, string>

isBannerActive()

Is the banner active?

public isBannerActive() : bool
Return values
bool

isBlockerActive()

Is the content blocker active?

public isBlockerActive() : bool
Return values
bool

overrideEnableOptionsAutoload()

public overrideEnableOptionsAutoload() : mixed

overrideRegister()

public overrideRegister() : mixed

register()

Register settings.

public register() : mixed

sanitize_delimited_list()

Sanitize a delimiter-separated list option that pre-dates WP 5.3's native array option type (e.g. CSV of page IDs / country codes, pipe-separated forward-to URLs). Splits `$value` on `$delimiter`, applies `$itemSanitizer` to each raw token, drops tokens that become empty after sanitization and rejoins with the same delimiter.

public static sanitize_delimited_list(mixed $value[, string $delimiter = ',' ][, callable $itemSanitizer = 'sanitize_text_field' ]) : mixed

Returns '' for any non-string input so callers do not need a setting-specific fallback; a missing / mistyped option simply becomes the empty list.

Parameters
$value : mixed
$delimiter : string = ','
$itemSanitizer : callable = 'sanitize_text_field'

Receives one raw token (string) and returns the sanitized scalar.

sanitize_operator_country()

Sanitize operator country option for persistence and REST.

public static sanitize_operator_country(mixed $value) : mixed
Parameters
$value : mixed

sanitize_set_cookies_via_manager()

Sanitize tag manager integration mode option.

public static sanitize_set_cookies_via_manager(mixed $value) : mixed
Parameters
$value : mixed

Sanitize territorial legal basis list stored as a comma-separated string.

public static sanitize_territorial_legal_basis(mixed $value) : mixed
Parameters
$value : mixed

__construct()

C'tor.

private __construct() : mixed
On this page

Search results