Constants

QUERY_BLOG_ID

QUERY_BLOG_ID ='blog'

ENDPOINT_FILTER_ALL

ENDPOINT_FILTER_ALL ='all'

ENDPOINT_FILTER_NOT_CURRENT

ENDPOINT_FILTER_NOT_CURRENT ='notCurrent'

ENDPOINT_FILTER_ONLY_CURRENT

ENDPOINT_FILTER_ONLY_CURRENT ='onlyCurrent'

ALL_ENDPOINT_FILTERS

ALL_ENDPOINT_FILTERS =array(self::ENDPOINT_FILTER_ALL, self::ENDPOINT_FILTER_NOT_CURRENT, self::ENDPOINT_FILTER_ONLY_CURRENT)

Properties

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

Returns

string

persist()

persist(string  $uuid,integer  $consentId,array<mixed,string>  $cookies,string  $buttonClicked,integer  $viewPortWidth,integer  $viewPortHeight,string  $referer,boolean  $blocker,string  $tcfString): array

Persist a forwarded user consent to the database.

Parameters

string $uuid
integer $consentId
array<mixed,string> $cookies
string $buttonClicked
integer $viewPortWidth
integer $viewPortHeight
string $referer
boolean $blocker

If the consent came from a content blocker, mark this in our database

string $tcfString

Returns

array —

Result of MyConsent#persist()

revisionArrayIndependent()

revisionArrayIndependent(array  $result)

Modify independent revision array and add the external hosts of consent forwarding.

Parameters

array $result

localize()

localize(array  $arr)

Localize frontend.

Parameters

array $arr

consentCreatedResponse()

consentCreatedResponse(array  $result,\WP_REST_Request  $request)

Modify the response of the Consent API and add a `forward` property if Consent Forwarding is available. The client needs to handle the rest.

Parameters

array $result
\WP_REST_Request $request

getByUniqueName()

getByUniqueName(string  $slug)

Get all available cookies by an unique name.

Parameters

string $slug

getExternalHosts()

getExternalHosts()

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

Returns false if no external host gets contacted.

getCurrentEndpoints()

getCurrentEndpoints(): array<mixed,string>

Get the endpoints computed for the current context.

Returns

array<mixed,string>

getAvailableEndpoints()

getAvailableEndpoints(string  $filter = self::ENDPOINT_FILTER_ALL)

See filter RCB/Forward/Endpoints.

Parameters

string $filter

getInstance()

getInstance()

Get singleton instance.

uniqueNamesToCookieIds()

uniqueNamesToCookieIds(array<mixed,string>  $cookies)

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

It automatically accepts all essential cookies.

Parameters

array<mixed,string> $cookies

groupIdsToUniqueName()

groupIdsToUniqueName(array<mixed,integer>  $groupsIds)

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

Parameters

array<mixed,integer> $groupsIds

cookieIdsToUniqueName()

cookieIdsToUniqueName(array  $decision)

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

Parameters

array $decision

__construct()

__construct()

C'tor.