Hooks
in package
Uses
UtilsProvider
Language specific action and filters for Real Cookie Banner.
Table of Contents
Constants
- MINIMAL_TRANSLATION_CODES = ['tr_TR', 'ru_RU', 'bg_BG']
- See `self::getActiveMinimalTranslations`.
- TD_FORCED = RCB_TD . '-forced'
Properties
- $me : Hooks
- Singleton instance.
- $temporaryTextDomain : TemporaryTextDomain
- Temporary text domain.
Methods
- context() : mixed
- Add the current language code as independent context.
- contextTranslate() : mixed
- Translate language context to human readable form.
- copy_blocker_connected_services_meta() : mixed
- Modify content blocker `services` / `tcfVendors` meta field to match the translated post ids.
- createTemporaryTextDomain() : mixed
- Create a temporary text domain of the current language.
- getActiveMinimalTranslations() : mixed
- In `src/languages-local` we provide a set of minimal translations for texts needed in the frontend of Real Cookie Banner. All other texts are translateable through our UI and customizer.
- getInstance() : Hooks
- Get singleton instance.
- getLanguagesWithoutEssentialGroup() : mixed
- Get all languages within a `AbstractSyncPlugin` (like WPML or PolyLang) which does currently not hold any essential group. This is necessary e.g. to copy content to newly added languages.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- getTemporaryTextDomain() : mixed
- Getter.
- hints() : mixed
- Custom hints for multilingual.
- queryArguments() : mixed
- Query arguments `lang`.
- rest_api_init() : mixed
- Create temporary text domain.
- rest_query() : mixed
- Modify query for REST queries.
- revisionHash() : mixed
- A new revision was requested, let's recreate also for other languages.
- revisionNeedsRetrigger() : mixed
- Check if any of the other languages needs a revision retrigger. This is only relevant for output buffer multilingual plugins (e.g. TranslatePress).
- compInstance() : mixed
- Get compatibility language instance.
Constants
MINIMAL_TRANSLATION_CODES
See `self::getActiveMinimalTranslations`.
public
mixed
MINIMAL_TRANSLATION_CODES
= ['tr_TR', 'ru_RU', 'bg_BG']
TD_FORCED
public
mixed
TD_FORCED
= RCB_TD . '-forced'
Properties
$me
Singleton instance.
private
static Hooks
$me
= null
$temporaryTextDomain
Temporary text domain.
private
TemporaryTextDomain
$temporaryTextDomain
= null
Methods
context()
Add the current language code as independent context.
public
context(array<string|int, mixed> $contexts) : mixed
Parameters
- $contexts : array<string|int, mixed>
contextTranslate()
Translate language context to human readable form.
public
contextTranslate(string $context) : mixed
Parameters
- $context : string
copy_blocker_connected_services_meta()
Modify content blocker `services` / `tcfVendors` meta field to match the translated post ids.
public
copy_blocker_connected_services_meta(string $meta_value, int $from, int $to, string $locale, string $meta_key) : mixed
Parameters
- $meta_value : string
- $from : int
-
Object id of source language item
- $to : int
-
Object id of destination language item
- $locale : string
- $meta_key : string
createTemporaryTextDomain()
Create a temporary text domain of the current language.
public
createTemporaryTextDomain([string $locale = null ]) : mixed
Parameters
- $locale : string = null
-
If given, it will use that locale in WordPress format, instead of the current language
getActiveMinimalTranslations()
In `src/languages-local` we provide a set of minimal translations for texts needed in the frontend of Real Cookie Banner. All other texts are translateable through our UI and customizer.
public
getActiveMinimalTranslations() : mixed
getInstance()
Get singleton instance.
public
static getInstance() : Hooks
Tags
Return values
HooksgetLanguagesWithoutEssentialGroup()
Get all languages within a `AbstractSyncPlugin` (like WPML or PolyLang) which does currently not hold any essential group. This is necessary e.g. to copy content to newly added languages.
public
getLanguagesWithoutEssentialGroup() : mixed
getPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringgetTemporaryTextDomain()
Getter.
public
getTemporaryTextDomain() : mixed
Tags
hints()
Custom hints for multilingual.
public
hints(array<string|int, mixed> $hints) : mixed
Parameters
- $hints : array<string|int, mixed>
queryArguments()
Query arguments `lang`.
public
queryArguments(array<string|int, mixed> $arguments) : mixed
Parameters
- $arguments : array<string|int, mixed>
rest_api_init()
Create temporary text domain.
public
rest_api_init() : mixed
rest_query()
Modify query for REST queries.
public
rest_query(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
-
Key value array of query var to query value.
revisionHash()
A new revision was requested, let's recreate also for other languages.
public
revisionHash(array<string|int, mixed> $result) : mixed
Parameters
- $result : array<string|int, mixed>
revisionNeedsRetrigger()
Check if any of the other languages needs a revision retrigger. This is only relevant for output buffer multilingual plugins (e.g. TranslatePress).
public
revisionNeedsRetrigger(bool $needs_retrigger) : mixed
Parameters
- $needs_retrigger : bool
compInstance()
Get compatibility language instance.
protected
compInstance() : mixed