action
Fires when more than one multilingual plugin is active.
Parameters of davo_language_provider_conflict Parameter Type Description $ids string[] Provider IDs, in priority order. The first one is used.
add_action Copyadd_action ( 'davo_language_provider_conflict' , 'my_action_callback' , 10 , 1 );
/**
* @param string[] $ids
*/
function my_action_callback ( $ids ) {
// Your code here.
}src/domains/language/registry.php:98
filter
Filters the multilingual adapters, highest priority first.
Parameters of davo_language_providers Parameter Type Description $providers Language_Provider[] Adapters. Entries that are not providers are ignored.
add_filter Copyadd_filter ( 'davo_language_providers' , 'my_filter_callback' , 10 , 1 );
/**
* @param Language_Provider[] $providers
*/
function my_filter_callback ( $providers ) {
// Change $providers as needed, then return it.
return $providers ;
}src/domains/language/registry.php:65
action
Fires when the active multilingual plugin collects strings for translation.
Parameters of davo_language_register_strings Parameter Type Description $strings Language_Strings Service to register strings with.
add_action Copyadd_action ( 'davo_language_register_strings' , 'my_action_callback' , 10 , 1 );
/**
* @param Language_Strings $strings
*/
function my_action_callback ( $strings ) {
// Your code here.
}src/domains/language/strings.php:120
filter
Filters whether a query run during a language-scoped REST request is restricted to that language.
Parameters of davo_language_scope_query Parameter Type Description $scope bool Whether to scope. Default true. $query WP_Query The query. $code string Language code of the request.
add_filter Copyadd_filter ( 'davo_language_scope_query' , 'my_filter_callback' , 10 , 3 );
/**
* @param bool $scope
* @param WP_Query $query
* @param string $code
*/
function my_filter_callback ( $scope , $query , $code ) {
// Change $scope as needed, then return it.
return $scope ;
}src/domains/language/query-scope.php:143
filter
Filters the language switcher view model.
Parameters of davo_language_state Parameter Type Description $state array<string, mixed> View model. $provider Language_Provider Adapter that produced it.
add_filter Copyadd_filter ( 'davo_language_state' , 'my_filter_callback' , 10 , 2 );
/**
* @param array<string, mixed> $state
* @param Language_Provider $provider
*/
function my_filter_callback ( $state , $provider ) {
// Change $state as needed, then return it.
return $state ;
}src/domains/language/repository.php:198
filter
Filters what the switcher does with a language that has no translation of the current page.
link goes to whatever URL the plugin offers (usually that language's home page), disable shows the language but does not link it, and hide leaves it out.
Parameters of davo_language_untranslated_policy Parameter Type Description $policy string link, disable or hide.
add_filter Copyadd_filter ( 'davo_language_untranslated_policy' , 'my_filter_callback' , 10 , 1 );
/**
* @param string $policy
*/
function my_filter_callback ( $policy ) {
// Change $policy as needed, then return it.
return $policy ;
}src/domains/language/repository.php:74
action
Fires when the search index should be rebuilt in full.
The Search domain queues a background reindex of every source.
add_action Copyadd_action ( 'davo_search_schedule_reindex' , 'my_action_callback' , 10 , 1 );
function my_action_callback ( $arg1 ) {
// Your code here.
}src/domains/language/search.php:134