General
extends AbstractGeneral
in package
implements
IOverrideGeneral
uses
General, UtilsProvider
General settings.
Table of Contents
Interfaces
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
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
DEFAULT_COOKIE_POLICY_ID
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'
LEGAL_BASIS_ALLOWED
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'
SETTING_COOKIE_POLICY_ID
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'
SETTING_TERRITORIAL_LEGAL_BASIS
public
mixed
SETTING_TERRITORIAL_LEGAL_BASIS
= RCB_OPT_PREFIX . '-territorial-legal-basis'
TERRITORIAL_LEGAL_BASIS_DSG_SWITZERLAND
public
mixed
TERRITORIAL_LEGAL_BASIS_DSG_SWITZERLAND
= 'dsg-switzerland'
TERRITORIAL_LEGAL_BASIS_GDPR
public
mixed
TERRITORIAL_LEGAL_BASIS_GDPR
= 'gdpr-eprivacy'
Properties
$me
Singleton instance.
private
static General
$me
= null
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
getBannerLinks()
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
intgetCookiePolicyUrl()
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
Return values
GeneralgetLanguages()
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
stringgetOperatorContactEmail()
Get configured operator contact email.
public
getOperatorContactEmail() : string
Return values
stringgetOperatorContactFormId()
Get the operator contact form page ID.
public
getOperatorContactFormId() : int
Return values
intgetOperatorContactFormUrl()
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
stringgetOperatorCountry()
Get configured operator country.
public
getOperatorCountry() : string
Return values
stringgetPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringgetServiceGroups()
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
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
boolisBlockerActive()
Is the content blocker active?
public
isBlockerActive() : bool
Return values
booloverrideEnableOptionsAutoload()
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()
Sanitize territorial legal basis list stored as a comma-separated string.
public
static sanitize_territorial_legal_basis(mixed $value) : mixed
Parameters
- $value : mixed
setSettings()
Setter.
public
setSettings(Settings $settings) : mixed
Parameters
- $settings : Settings
Tags
__construct()
C'tor.
private
__construct() : mixed