Links

Other Hooks

Auto-generated filters. Contains all the filter in Weglot's plugin code

Hook: weglot_translate_email

Description

File: src/actions/class-email-translate-weglot.php
Type: Filter
Parameter: $email_translate, $args

Declaration:

$translate_email = apply_filters( 'weglot_translate_email', $this->option_services->get_option( 'email_translate' ), $args );

Code exemple:

add_filter( 'weglot_translate_email', 'prefix_weglot_translate_email' );
function prefix_weglot_translate_email( $email_translate, $args ) {
// Code
return $email_translate;
}

Hook: weglot_language_code_replace

Description

You can find the more documentation and example about this hook here : https://developers.weglot.com/wordpress/use-cases/use-custom-language-code-url-lang-and-hreflang-attribute
Type: Filter
Parameter: $replacements

Declaration:

$language_code_rewrited = apply_filters('weglot_language_code_replace' , array());

Code exemple:

add_filter( 'weglot_language_code_replace', 'prefix_weglot_weglot_language_code_replace' );
function prefix_weglot_weglot_language_code_replace( $replacements ) {
// Code
return $replacements;
}

Hook: weglot_get_rest_current_url_path

Description

File: weglot-functions.php
Type: Filter
Parameter: $current_url

Declaration:

return apply_filters( 'weglot_get_rest_current_url_path', $current_url['path'] );

Code exemple:

add_filter( 'weglot_get_rest_current_url_path', 'prefix_weglot_get_rest_current_url_path' );
function prefix_weglot_get_rest_current_url_path( $current_url ) {
// Code
return $current_url;
}

Hook: weglot_ninja_forms_is_active

Description

File: ./src/third/ninjaforms/class-ninja-active.php
Type: Filter
Parameter: $active

Declaration:

return apply_filters( 'weglot_ninja_forms_is_active', $active );

Code exemple:

add_filter( 'weglot_ninja_forms_is_active', 'prefix_weglot_ninja_forms_is_active' );
function prefix_weglot_ninja_forms_is_active( $active ) {
// Code
return $active;
}

Hook: weglot_wc_reload_selector

Description

File: ./src/third/woocommerce/class-wc-cart-reload-weglot.php
Type: Filter
Parameter: $string

Declaration:

$click_selector = apply_filters( 'weglot_wc_reload_selector', '.weglot-lang a' );

Code exemple:

add_filter( 'weglot_wc_reload_selector', 'prefix_weglot_wc_reload_selector' );
function prefix_weglot_wc_reload_selector( $string ) {
// Code
return $string;
}

Hook: weglot_caldera_forms_is_active

Description

File: ./src/third/calderaforms/class-caldera-active.php
Type: Filter
Parameter: $active

Declaration:

return apply_filters( 'weglot_caldera_forms_is_active', $active );

Code exemple:

add_filter( 'weglot_caldera_forms_is_active', 'prefix_weglot_caldera_forms_is_active' );
function prefix_weglot_caldera_forms_is_active( $active ) {
// Code
return $active;
}

Hook: weglot_wpforms_is_active

Description

File: ./src/third/wpforms/class-wpforms-active.php
Type: Filter
Parameter: $active

Declaration:

return apply_filters( 'weglot_wpforms_is_active', $active );

Code exemple:

add_filter( 'weglot_wpforms_is_active', 'prefix_weglot_wpforms_is_active' );
function prefix_weglot_wpforms_is_active( $active ) {
// Code
return $active;
}

Hook: weglot_regex_amp

Description

File: ./src/third/amp/class-amp-service-weglot.php
Type: Filter
Parameter: $regex

Declaration:

return apply_filters( 'weglot_regex_amp', $regex );

Code exemple:

add_filter( 'weglot_regex_amp', 'prefix_weglot_regex_amp' );
function prefix_weglot_regex_amp( $regex ) {
// Code
return $regex;
}

Hook: weglot_another_redirect_override

Description

File: ./src/third/yoast/class-redirect-handler-weglot.php
Parameter: $request_url

Declaration:

do_action( 'weglot_another_redirect_override', $this->request_url );

Code exemple:

add_action( 'weglot_another_redirect_override', 'prefix_weglot_another_redirect_override' );
function prefix_weglot_another_redirect_override( $request_url ) {
// Code
}

Hook: weglot_ucp_is_active

Description

File: ./src/third/underconstructionpage/class-ucp-active.php
Type: Filter
Parameter: $active

Declaration:

return apply_filters( 'weglot_ucp_is_active', $active );

Code exemple:

add_filter( 'weglot_ucp_is_active', 'prefix_weglot_ucp_is_active' );
function prefix_weglot_ucp_is_active( $active ) {
// Code
return $active;
}

Hook: weglot_menu_parent_menu_item_title

Description

File: ./src/actions/front/class-front-menu-weglot.php
Type: Filter
Parameter: $title

Declaration:

$item->title = apply_filters( 'weglot_menu_parent_menu_item_title', $title );

Code exemple:

add_filter( 'weglot_menu_parent_menu_item_title', 'prefix_weglot_menu_parent_menu_item_title' );
function prefix_weglot_menu_parent_menu_item_title( $title ) {
// Code
return $title;
}

Hook: weglot_query_vars_check

Description

File: ./src/actions/front/class-search-weglot.php
Type: Filter
Parameter: $string

Declaration:

$query_vars_check = apply_filters( 'weglot_query_vars_check', 's' );

Code exemple:

add_filter( 'weglot_query_vars_check', 'prefix_weglot_query_vars_check' );
function prefix_weglot_query_vars_check( $string ) {
// Code
return $string;
}

Hook: weglot_active_translation_before_process

Description

File: ./src/actions/front/class-translate-page-weglot.php
Type: Filter
Parameter: $bool

Declaration:

$active_translation = apply_filters( 'weglot_active_translation_before_process', true );

Code exemple:

add_filter( 'weglot_active_translation_before_process', 'prefix_weglot_active_translation_before_process' );
function prefix_weglot_active_translation_before_process( $bool ) {
// Code
return $bool;
}

Hook: weglot_active_translation_before_treat_page

Description

File: ./src/actions/front/class-translate-page-weglot.php
Type: Filter
Parameter: $bool

Declaration:

$active_translation = apply_filters( 'weglot_active_translation_before_treat_page', true );

Code exemple:

add_filter( 'weglot_active_translation_before_treat_page', 'prefix_weglot_active_translation_before_treat_page' );
function prefix_weglot_active_translation_before_treat_page( $bool ) {
// Code
return $bool;
}

Hook: weglot_debug_file

Description

File: ./src/actions/front/class-translate-page-weglot.php
Type: Filter
Parameter: $weglot_dir_string

Declaration:

$file = apply_filters( 'weglot_debug_file', WEGLOT_DIR . '/content.html' );

Code exemple:

add_filter( 'weglot_debug_file', 'prefix_weglot_debug_file' );
function prefix_weglot_debug_file( $weglot_dir_string ) {
// Code
return $weglot_dir_string;
}

Hook: weglot_get_clean_base_url

Description

File: ./src/helpers/class-helper-filter-url-weglot.php
Type: Filter
Parameter: $url

Declaration:

return apply_filters( 'weglot_get_clean_base_url', $url );

Code exemple:

add_filter( 'weglot_get_clean_base_url', 'prefix_weglot_get_clean_base_url' );
function prefix_weglot_get_clean_base_url( $url ) {
// Code
return $url;
}

Hook: weglot_helper_filter_url_lambda

Description

File: ./src/helpers/class-helper-filter-url-weglot.php
Type: Filter
Parameter: $prevent_subfolder_install

Declaration:

return apply_filters( 'weglot_helper_filter_url_lambda', self::prevent_subfolder_install( $url ) );

Code exemple:

add_filter( 'weglot_helper_filter_url_lambda', 'prefix_weglot_helper_filter_url_lambda' );
function prefix_weglot_helper_filter_url_lambda( $prevent_subfolder_install ) {
// Code
return $prevent_subfolder_install;
}

Hook: weglot_helper_filter_url_without_ajax

Description

File: ./src/helpers/class-helper-filter-url-weglot.php
Type: Filter
Parameter: $prevent_subfolder_install

Declaration:

return apply_filters( 'weglot_helper_filter_url_without_ajax', self::prevent_subfolder_install( $url ) );

Code exemple:

add_filter( 'weglot_helper_filter_url_without_ajax', 'prefix_weglot_helper_filter_url_without_ajax' );
function prefix_weglot_helper_filter_url_without_ajax( $prevent_subfolder_install ) {
// Code
return $prevent_subfolder_install;
}

Description

File: ./src/helpers/class-helper-replace-url-weglot.php
Type: Filter
Parameter: $data

Declaration:

return apply_filters( 'weglot_get_replace_modify_link', $data );

Code exemple:

add_filter( 'weglot_get_replace_modify_link', 'prefix_weglot_get_replace_modify_link' );
function prefix_weglot_get_replace_modify_link( $data ) {
// Code
return $data;
}

Hook: weglot_get_flag_class

Description

File: ./src/services/class-button-service-weglot.php
Type: Filter
Parameter: $flag_class

Declaration:

return apply_filters( 'weglot_get_flag_class', $flag_class );

Code exemple:

add_filter( 'weglot_get_flag_class', 'prefix_weglot_get_flag_class' );
function prefix_weglot_get_flag_class( $flag_class ) {
// Code
return $flag_class;
}

Hook: weglot_get_name_with_language_entry

Description

File: ./src/services/class-button-service-weglot.php
Type: Filter
Parameters: $name, $language_entry

Declaration:

return apply_filters( 'weglot_get_name_with_language_entry', $name, $language_entry );

Code exemple:

add_filter( 'weglot_get_name_with_language_entry', 'prefix_weglot_get_name_with_language_entry', 10, 2 );
function prefix_weglot_get_name_with_language_entry( $name, $language_entry ) {
// Code
return $name;
}

Hook: weglot_get_class_dropdown

Description

File: ./src/services/class-button-service-weglot.php
Type: Filter
Parameter: $class

Declaration:

return apply_filters( 'weglot_get_class_dropdown', $class );

Code exemple:

add_filter( 'weglot_get_class_dropdown', 'prefix_weglot_get_class_dropdown' );
function prefix_weglot_get_class_dropdown( $class ) {
// Code
return $class;
}

Hook: weglot_button_html

Description

File: ./src/services/class-button-service-weglot.php
Type: Filter
Parameters: $button_html, $add_class

Declaration:

return apply_filters( 'weglot_button_html', $button_html, $add_class );

Code exemple:

add_filter( 'weglot_button_html', 'prefix_weglot_button_html', 10, 2 );
function prefix_weglot_button_html( $button_html, $add_class ) {
// Code
return $button_html;
}

Description

File: ./src/services/class-custom-url-service-weglot.php
Type: Filter
Parameters: $url_lang, $key_code

Declaration:

$link_button = apply_filters( 'weglot_link_language', $url_lang, $key_code );

Code exemple:

add_filter( 'weglot_link_language', 'prefix_weglot_link_language', 10, 2 );
function prefix_weglot_link_language( $url_lang, $key_code ) {
// Code
return $url_lang;
}

Description

File: ./src/services/class-custom-url-service-weglot.php
Type: Filter
Parameter: $link_button

Declaration:

return apply_filters( 'weglot_get_link_with_key_code', $link_button );

Code exemple:

add_filter( 'weglot_get_link_with_key_code', 'prefix_weglot_get_link_with_key_code' );
function prefix_weglot_get_link_with_key_code( $link_button ) {
// Code
return $link_button;
}

Description

File: ./src/services/class-custom-url-service-weglot.php
Type: Filter
Parameter: $link_button

Declaration:

return apply_filters( 'weglot_get_link_button_with_key_code', $link_button );

Code exemple:

add_filter( 'weglot_get_link_button_with_key_code', 'prefix_weglot_get_link_button_with_key_code' );
function prefix_weglot_get_link_button_with_key_code( $link_button ) {
// Code
return $link_button;
}

Hook: weglot_get_dom_checkers

Description

File: ./src/services/class-dom-checkers-service-weglot.php
Type: Filter
Parameter: $checkers

Declaration:

return apply_filters( 'weglot_get_dom_checkers', $checkers );

Code exemple:

add_filter( 'weglot_get_dom_checkers', 'prefix_weglot_get_dom_checkers' );
function prefix_weglot_get_dom_checkers( $checkers ) {
// Code
return $checkers;
}

Hook: weglot_get_dom_listeners

Description

File: ./src/services/class-dom-listeners-service-weglot.php
Type: Filter
Parameter: $dom_listeners

Declaration:

return apply_filters( 'weglot_get_dom_listeners', $this->dom_listeners );

Code exemple:

add_filter( 'weglot_get_dom_listeners', 'prefix_weglot_get_dom_listeners' );
function prefix_weglot_get_dom_listeners( $dom_listeners ) {
// Code
return $dom_listeners;
}

Hook: weglot_replace_div_id

Description

File: ./src/services/class-generate-switcher-service-weglot.php
Type: Filter
Parameter: $dom

Declaration:

return apply_filters( 'weglot_replace_div_id', $dom );

Code exemple:

add_filter( 'weglot_replace_div_id', 'prefix_weglot_replace_div_id' );
function prefix_weglot_replace_div_id( $dom ) {
// Code
return $dom;
}

Hook: weglot_replace_weglot_menu

Description

File: ./src/services/class-generate-switcher-service-weglot.php
Type: Filter
Parameter: $dom

Declaration:

return apply_filters( 'weglot_replace_weglot_menu', $dom );

Code exemple:

add_filter( 'weglot_replace_weglot_menu', 'prefix_weglot_replace_weglot_menu' );
function prefix_weglot_replace_weglot_menu( $dom ) {
// Code
return $dom;
}

Hook: weglot_render_default_button

Description

File: ./src/services/class-generate-switcher-service-weglot.php
Type: Filter
Parameter: $dom

Declaration:

return apply_filters( 'weglot_render_default_button', $dom );

Code exemple:

add_filter( 'weglot_render_default_button', 'prefix_weglot_render_default_button' );
function prefix_weglot_render_default_button( $dom ) {
// Code
return $dom;
}

Hook: weglot_generate_switcher_from_dom

Description

File: ./src/services/class-generate-switcher-service-weglot.php
Type: Filter
Parameter: $dom

Declaration:

return apply_filters( 'weglot_generate_switcher_from_dom', $dom );

Code exemple:

add_filter( 'weglot_generate_switcher_from_dom', 'prefix_weglot_generate_switcher_from_dom' );
function prefix_weglot_generate_switcher_from_dom( $dom ) {
// Code
return $dom;
}

Hook: weglot_href_lang

Description

File: ./src/services/class-href-lang-service-weglot.php
Type: Filter
Parameter: $render

Declaration:

return apply_filters( 'weglot_href_lang', $render );

Code exemple:

add_filter( 'weglot_href_lang', 'prefix_weglot_href_lang' );
function prefix_weglot_href_lang( $render ) {
// Code
return $render;
}

Hook: weglot_current_language_entry

Description

File: ./src/services/class-language-service-weglot.php
Type: Filter
Parameter: $key_code

Declaration:

$current_language_entry = apply_filters( 'weglot_current_language_entry', $key_code );

Code exemple:

add_filter( 'weglot_current_language_entry', 'prefix_weglot_current_language_entry' );
function prefix_weglot_current_language_entry( $key_code ) {
// Code
return $key_code;
}

Hook: weglot_get_options_from_cdn_cache

Description

File: ./src/services/class-option-service-weglot.php
Type: Filter
Parameter: $bool

Declaration:

$cache_transient = apply_filters( 'weglot_get_options_from_cdn_cache', true );

Code exemple:

add_filter( 'weglot_get_options_from_cdn_cache', 'prefix_weglot_get_options_from_cdn_cache' );
function prefix_weglot_get_options_from_cdn_cache( $bool ) {
// Code
return $bool;
}

Hook: weglot_get_options_from_cdn_cache_duration

Description

File: ./src/services/class-option-service-weglot.php
Type: Filter
Parameter: $300

Declaration:

set_transient( 'weglot_cache_cdn', $body, apply_filters( 'weglot_get_options_from_cdn_cache_duration', 300 ) );

Code exemple:

add_filter( 'weglot_get_options_from_cdn_cache_duration', 'prefix_weglot_get_options_from_cdn_cache_duration' );
function prefix_weglot_get_options_from_cdn_cache_duration( $300 ) {
// Code
return $300;
}

Hook: weglot_get_options

Description

File: ./src/services/class-option-service-weglot.php
Type: Filter
Parameters: $array_merge, $body

Declaration:

$options = apply_filters( 'weglot_get_options', array_merge( $this->get_options_bdd_v3(), $body ) );

Code exemple:

add_filter( 'weglot_get_options', 'prefix_weglot_get_options', 10, 2 );
function prefix_weglot_get_options( $array_merge, $body ) {
// Code
return $array_merge;
}

Hook: weglot_get_api_key

Description

File: ./src/services/class-option-service-weglot.php
Type: Filter
Parameter: $api_key

Declaration:

return apply_filters( 'weglot_get_api_key', $api_key );

Code exemple:

add_filter( 'weglot_get_api_key', 'prefix_weglot_get_api_key' );
function prefix_weglot_get_api_key( $api_key ) {
// Code
return $api_key;
}

Hook: weglot_get_api_key

Description

File: ./src/services/class-option-service-weglot.php
Type: Filter
Parameter: $options

Declaration:

return apply_filters( 'weglot_get_api_key', $options['api_key'] );

Code exemple:

add_filter( 'weglot_get_api_key', 'prefix_weglot_get_api_key' );
function prefix_weglot_get_api_key( $options ) {
// Code
return $options;
}

Hook: weglot_get_options

Description

File: ./src/services/class-option-service-weglot.php
Type: Filter
Parameters: $array_merge, $options

Declaration:

$options = apply_filters( 'weglot_get_options', array_merge( $this->options_bdd_default, $this->get_options_bdd_v3(), $options ) );

Code exemple:

add_filter( 'weglot_get_options', 'prefix_weglot_get_options', 10, 2 );
function prefix_weglot_get_options( $array_merge, $options ) {
// Code
return $array_merge;
}

Hook: weglot_exclude_blocks

Description

Permet de modifier l'array des exclusions par défault. Par exemple si on veut enlever de la liste des exclusions un élement on peut utiliser ce filtre. (Voir exemple ci dessous)
File: ./src/services/class-option-service-weglot.php
Type: Filter
Parameter: $exclude_blocks

Declaration:

return apply_filters( 'weglot_exclude_blocks', $exclude_blocks );

Code exemple:

// Ce code permet d'enlever .amount de l'exclusion
add_filter( 'weglot_exclude_blocks', 'prefix_weglot_exclude_blocks' );
function prefix_weglot_exclude_blocks( $exclude_blocks ) {
unset($exclude_blocks[array_search(".amount", $exclude_blocks)]);
return $exclude_blocks;
}

Hook: weglot_destination_languages

Description

File: ./src/services/class-option-service-weglot.php