Documentation

Multisite extends AbstractMultisite
in package
implements IOverrideMultisite Uses Multisite, UtilsProvider

Consent Forwarding settings.

Table of Contents

Interfaces

IOverrideMultisite

Constants

ALL_ENDPOINT_FILTERS  = [self::ENDPOINT_FILTER_ALL, self::ENDPOINT_FILTER_NOT_CURRENT, self::ENDPOINT_FILTER_ONLY_CURRENT]
DEFAULT_CONSENT_FORWARDING  = false
DEFAULT_CROSS_DOMAINS  = ''
DEFAULT_FORWARD_TO  = ''
ENDPOINT_FILTER_ALL  = 'all'
ENDPOINT_FILTER_NOT_CURRENT  = 'notCurrent'
ENDPOINT_FILTER_ONLY_CURRENT  = 'onlyCurrent'
FORWARDING_QUERY_BLOG_ID  = 'blog'
OPTION_GROUP  = 'options'
SETTING_CONSENT_FORWARDING  = RCB_OPT_PREFIX . '-consent-forwarding'
SETTING_CROSS_DOMAINS  = RCB_OPT_PREFIX . '-cross-domains'
SETTING_FORWARD_TO  = RCB_OPT_PREFIX . '-forward-to'

Properties

$me  : Multisite
Singleton instance.
$settings  : Settings
See Settings

Methods

enableOptionsAutoload()  : mixed
Initially `add_option` to avoid autoloading issues.
getAvailableEndpoints()  : array<string|int, mixed>
Get all available and predefined endpoints within this environment. E. g. if your are running within a mulitisite, you will get all available WP REST API endpoints for each site within this multisite. That means, you need to add your endpoint as follows: `$endpoints["https://example.com/wp-json/real-cookie-banner/v1/consent/forward"] = 'My example'.`
getConfiguredEndpoints()  : array<string|int, string>
Get the available endpoints which are part of this environment and active for the consent forwarding. Examples:
getCrossDomains()  : array<string|int, string>
Get forward to external URLs.
getEnvironmentHost()  : string
Get current host for the current environment where consent is processed.
getExternalHosts()  : array<string|int, string>
Check if external hosts need to be contacted and return the external hosts including subdomain.
getForwardTo()  : array<string|int, string>
Get forward to URLs within the network.
getInstance()  : Multisite
Get singleton instance.
getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
getSettings()  : mixed
Getter.
isConsentForwarding()  : bool
Check if consent should be forwarded.
mapDecisionToUniqueNames()  : array<string|int, string>
Transform a given consent decision (groups with service IDs) to a map of unique names.
mapUniqueNamesToDecision()  : mixed
Transform a given consent decision in string[] (`uniqueName`) to a map of groups with cookie ids.
overrideEnableOptionsAutoload()  : mixed
overrideRegister()  : mixed
register()  : mixed
Register settings.
setSettings()  : mixed
Setter.
updated_option_forward_to()  : mixed
The option "Forward to" got updated. Let's iterate all available sites and activate consent forwarding automatically.
__construct()  : mixed
C'tor.

Constants

ALL_ENDPOINT_FILTERS

public mixed ALL_ENDPOINT_FILTERS = [self::ENDPOINT_FILTER_ALL, self::ENDPOINT_FILTER_NOT_CURRENT, self::ENDPOINT_FILTER_ONLY_CURRENT]
public mixed DEFAULT_CONSENT_FORWARDING = false

DEFAULT_CROSS_DOMAINS

public mixed DEFAULT_CROSS_DOMAINS = ''

DEFAULT_FORWARD_TO

public mixed DEFAULT_FORWARD_TO = ''

ENDPOINT_FILTER_NOT_CURRENT

public mixed ENDPOINT_FILTER_NOT_CURRENT = 'notCurrent'

ENDPOINT_FILTER_ONLY_CURRENT

public mixed ENDPOINT_FILTER_ONLY_CURRENT = 'onlyCurrent'

FORWARDING_QUERY_BLOG_ID

public mixed FORWARDING_QUERY_BLOG_ID = 'blog'

OPTION_GROUP

public mixed OPTION_GROUP = 'options'
public mixed SETTING_CONSENT_FORWARDING = RCB_OPT_PREFIX . '-consent-forwarding'

SETTING_CROSS_DOMAINS

public mixed SETTING_CROSS_DOMAINS = RCB_OPT_PREFIX . '-cross-domains'

SETTING_FORWARD_TO

public mixed SETTING_FORWARD_TO = RCB_OPT_PREFIX . '-forward-to'

Properties

Methods

enableOptionsAutoload()

Initially `add_option` to avoid autoloading issues.

public enableOptionsAutoload() : mixed

getAvailableEndpoints()

Get all available and predefined endpoints within this environment. E. g. if your are running within a mulitisite, you will get all available WP REST API endpoints for each site within this multisite. That means, you need to add your endpoint as follows: `$endpoints["https://example.com/wp-json/real-cookie-banner/v1/consent/forward"] = 'My example'.`

public abstract getAvailableEndpoints([string $filter = self::ENDPOINT_FILTER_ALL ]) : array<string|int, mixed>
Parameters
$filter : string = self::ENDPOINT_FILTER_ALL

Can be all, notCurrent and onlyCurrent

Return values
array<string|int, mixed>

getConfiguredEndpoints()

Get the available endpoints which are part of this environment and active for the consent forwarding. Examples:

public abstract getConfiguredEndpoints() : array<string|int, string>
  • WordPress Multisite: Other subsites within the multisite network
  • WordPress Multilingual: Other URLs to other languages of the current website
Return values
array<string|int, string>

getCrossDomains()

Get forward to external URLs.

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

getEnvironmentHost()

Get current host for the current environment where consent is processed.

public getEnvironmentHost() : string
Return values
string

getExternalHosts()

Check if external hosts need to be contacted and return the external hosts including subdomain.

public getExternalHosts() : array<string|int, string>

Returns false if no external host gets contacted.

Return values
array<string|int, string>

getForwardTo()

Get forward to URLs within the network.

public abstract getForwardTo() : array<string|int, string>
Return values
array<string|int, 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

getSettings()

Getter.

public getSettings() : mixed
Tags
codeCoverageIgnore

isConsentForwarding()

Check if consent should be forwarded.

public abstract isConsentForwarding() : bool
Return values
bool

mapDecisionToUniqueNames()

Transform a given consent decision (groups with service IDs) to a map of unique names.

public mapDecisionToUniqueNames(array<string|int, mixed> $decision) : array<string|int, string>
Parameters
$decision : array<string|int, mixed>
Return values
array<string|int, string>

mapUniqueNamesToDecision()

Transform a given consent decision in string[] (`uniqueName`) to a map of groups with cookie ids.

public mapUniqueNamesToDecision(array<string|int, string> $uniqueNames) : mixed

It automatically accepts all essential services.

Parameters
$uniqueNames : array<string|int, string>

overrideEnableOptionsAutoload()

public overrideEnableOptionsAutoload() : mixed

overrideRegister()

public overrideRegister() : mixed

register()

Register settings.

public register() : mixed

updated_option_forward_to()

The option "Forward to" got updated. Let's iterate all available sites and activate consent forwarding automatically.

public updated_option_forward_to(string $option) : mixed
Parameters
$option : string

Name of the updated option

__construct()

C'tor.

private __construct() : mixed

        
On this page

Search results