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:

Code exemple:

Hook: weglot_get_rest_current_url_path

Description

File: weglot-functions.php

Type: Filter

Parameter: $current_url

Declaration:

Code exemple:

Hook: weglot_ninja_forms_is_active

Description

File: ./src/third/ninjaforms/class-ninja-active.php

Type: Filter

Parameter: $active

Declaration:

Code exemple:

Hook: weglot_wc_reload_selector

Description

File: ./src/third/woocommerce/class-wc-cart-reload-weglot.php

Type: Filter

Parameter: $string

Declaration:

Code exemple:

Hook: weglot_caldera_forms_is_active

Description

File: ./src/third/calderaforms/class-caldera-active.php

Type: Filter

Parameter: $active

Declaration:

Code exemple:

Hook: weglot_wpforms_is_active

Description

File: ./src/third/wpforms/class-wpforms-active.php

Type: Filter

Parameter: $active

Declaration:

Code exemple:

Hook: weglot_regex_amp

Description

File: ./src/third/amp/class-amp-service-weglot.php

Type: Filter

Parameter: $regex

Declaration:

Code exemple:

Hook: weglot_another_redirect_override

Description

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

Parameter: $request_url

Declaration:

Code exemple:

Hook: weglot_ucp_is_active

Description

File: ./src/third/underconstructionpage/class-ucp-active.php

Type: Filter

Parameter: $active

Declaration:

Code exemple:

Hook: weglot_menu_parent_menu_item_title

Description

File: ./src/actions/front/class-front-menu-weglot.php

Type: Filter

Parameter: $title

Declaration:

Code exemple:

Hook: weglot_query_vars_check

Description

File: ./src/actions/front/class-search-weglot.php

Type: Filter

Parameter: $string

Declaration:

Code exemple:

Hook: weglot_active_translation_before_process

Description

File: ./src/actions/front/class-translate-page-weglot.php

Type: Filter

Parameter: $bool

Declaration:

Code exemple:

Hook: weglot_active_translation_before_treat_page

Description

File: ./src/actions/front/class-translate-page-weglot.php

Type: Filter

Parameter: $bool

Declaration:

Code exemple:

Hook: weglot_debug_file

Description

File: ./src/actions/front/class-translate-page-weglot.php

Type: Filter

Parameter: $weglot_dir_string

Declaration:

Code exemple:

Hook: weglot_get_clean_base_url

Description

File: ./src/helpers/class-helper-filter-url-weglot.php

Type: Filter

Parameter: $url

Declaration:

Code exemple:

Hook: weglot_helper_filter_url_lambda

Description

File: ./src/helpers/class-helper-filter-url-weglot.php

Type: Filter

Parameter: $prevent_subfolder_install

Declaration:

Code exemple:

Hook: weglot_helper_filter_url_without_ajax

Description

File: ./src/helpers/class-helper-filter-url-weglot.php

Type: Filter

Parameter: $prevent_subfolder_install

Declaration:

Code exemple:

Description

File: ./src/helpers/class-helper-replace-url-weglot.php

Type: Filter

Parameter: $data

Declaration:

Code exemple:

Hook: weglot_get_flag_class

Description

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

Type: Filter

Parameter: $flag_class

Declaration:

Code exemple:

Hook: weglot_get_name_with_language_entry

Description

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

Type: Filter

Parameters: $name, $language_entry

Declaration:

Code exemple:

Hook: weglot_get_class_dropdown

Description

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

Type: Filter

Parameter: $class

Declaration:

Code exemple:

Hook: weglot_button_html

Description

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

Type: Filter

Parameters: $button_html, $add_class

Declaration:

Code exemple:

Description

File: ./src/services/class-custom-url-service-weglot.php

Type: Filter

Parameters: $url_lang, $key_code

Declaration:

Code exemple:

Description

File: ./src/services/class-custom-url-service-weglot.php

Type: Filter

Parameter: $link_button

Declaration:

Code exemple:

Description

File: ./src/services/class-custom-url-service-weglot.php

Type: Filter

Parameter: $link_button

Declaration:

Code exemple:

Hook: weglot_get_dom_checkers

Description

File: ./src/services/class-dom-checkers-service-weglot.php

Type: Filter

Parameter: $checkers

Declaration:

Code exemple:

Hook: weglot_get_dom_listeners

Description

File: ./src/services/class-dom-listeners-service-weglot.php

Type: Filter

Parameter: $dom_listeners

Declaration:

Code exemple:

Hook: weglot_replace_div_id

Description

File: ./src/services/class-generate-switcher-service-weglot.php

Type: Filter

Parameter: $dom

Declaration:

Code exemple:

Hook: weglot_replace_weglot_menu

Description

File: ./src/services/class-generate-switcher-service-weglot.php

Type: Filter

Parameter: $dom

Declaration:

Code exemple:

Hook: weglot_render_default_button

Description

File: ./src/services/class-generate-switcher-service-weglot.php

Type: Filter

Parameter: $dom

Declaration:

Code exemple:

Hook: weglot_generate_switcher_from_dom

Description

File: ./src/services/class-generate-switcher-service-weglot.php

Type: Filter

Parameter: $dom

Declaration:

Code exemple:

Hook: weglot_href_lang

Description

File: ./src/services/class-href-lang-service-weglot.php

Type: Filter

Parameter: $render

Declaration:

Code exemple:

Hook: weglot_current_language_entry

Description

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

Type: Filter

Parameter: $key_code

Declaration:

Code exemple:

Hook: weglot_get_options_from_cdn_cache

Description

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

Type: Filter

Parameter: $bool

Declaration:

Code exemple:

Hook: weglot_get_options_from_cdn_cache_duration

Description

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

Type: Filter

Parameter: $300

Declaration:

Code exemple:

Hook: weglot_get_options

Description

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

Type: Filter

Parameters: $array_merge, $body

Declaration:

Code exemple:

Hook: weglot_get_api_key

Description

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

Type: Filter

Parameter: $api_key

Declaration:

Code exemple:

Hook: weglot_get_api_key

Description

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

Type: Filter

Parameter: $options

Declaration:

Code exemple:

Hook: weglot_get_options

Description

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

Type: Filter

Parameters: $array_merge, $options

Declaration:

Code exemple:

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:

Code exemple:

Hook: weglot_destination_languages

Description

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

Type: Filter

Parameter: $destination_languages

Declaration:

Code exemple:

Hook: weglot_css_custom_inline

Description

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

Type: Filter

Parameter: $get_option

Declaration:

Code exemple:

Hook: weglot_flag_css

Description

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

Type: Filter

Parameter: $get_option

Declaration:

Code exemple:

Hook: weglot_get_translation_engine

Description

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

Type: Filter

Parameter: $get_option

Declaration:

Code exemple:

Hook: weglot_parser_config_provider

Description

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

Type: Filter

Parameter: $serverconfigprovider

Declaration:

Code exemple:

Hook: weglot_get_parser_ignored_nodes

Description

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

Type: Filter

Parameter: $parser_getignorednodesformatter_getignorednodes

Declaration:

Code exemple:

Hook: weglot_redirection_language_exception

Description

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

Type: Filter

Parameter: $server_lang

Declaration:

Code exemple:

Hook: weglot_url_auto_redirect

Description

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

Type: Filter

Parameter: $request_url_services_get_weglot_url_getforlanguage

Declaration:

Code exemple:

Hook: weglot_url_auto_redirect

Description

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

Type: Filter

Parameter: $request_url_services_get_weglot_url_getforlanguage

Declaration:

Code exemple:

Hook: weglot_words_translate

Description

File: ./src/services/class-regex-checkers-service-weglot.php

Type: Filter

Parameter: $int

Declaration:

Code exemple:

Hook: weglot_get_regex_checkers

Description

File: ./src/services/class-regex-checkers-service-weglot.php

Type: Filter

Parameter: $checkers

Declaration:

Code exemple:

Hook: weglot_no_replace_url_condition

Description

File: ./src/services/class-replace-link-service-weglot.php

Type: Filter

Parameter: $string

Declaration:

Code exemple:

Hook: weglot_no_replace_a_href

Description

File: ./src/services/class-replace-link-service-weglot.php

Type: Filter

Parameter: $string

Declaration:

Code exemple:

Description

File: ./src/services/class-replace-url-service-weglot.php

Type: Filter

Parameter: $dom

Declaration:

Code exemple:

Hook: weglot_ajax_replace_urls

Description

File: ./src/services/class-replace-url-service-weglot.php

Type: Filter

Parameter: $int

Declaration:

Code exemple:

Hook: weglot_length_replace_a

Description

File: ./src/services/class-replace-url-service-weglot.php

Type: Filter

Parameter: $int

Declaration:

Code exemple:

Description

File: ./src/services/class-replace-url-service-weglot.php

Type: Filter

Parameters: $string_type, $type

Declaration:

Code exemple:

Description

File: ./src/services/class-replace-url-service-weglot.php

Type: Filter

Parameter: $server

Declaration:

Code exemple:

Hook: weglot_default_current_language_empty

Description

File: ./src/services/class-request-url-service-weglot.php

Type: Filter

Parameter: $string

Declaration:

Code exemple:

Hook: weglot_translate_current_language

Description

File: ./src/services/class-request-url-service-weglot.php

Type: Filter

Parameter: $current_language

Declaration:

Code exemple:

Hook: weglot_is_eligible_url

Description

File: ./src/services/class-request-url-service-weglot.php

Type: Filter

Parameters: $bool, $weglot_url

Declaration:

Code exemple:

Hook: weglot_is_eligible_url

Description

File: ./src/services/class-request-url-service-weglot.php

Type: Filter

Parameters: $bool, $weglot_url

Declaration:

Code exemple:

Hook: weglot_is_eligible_url

Description

File: ./src/services/class-request-url-service-weglot.php

Type: Filter

Parameters: $bool, $url

Declaration:

Code exemple:

Hook: weglot_type_treat_page

Description

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

Type: Filter

Parameter: $type

Declaration:

Code exemple:

Hook: weglot_active_translation

Description

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

Type: Filter

Parameter: $bool

Declaration:

Code exemple:

Hook: weglot_add_json_keys

Description

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

Type: Filter

Parameter: $array

Declaration:

Code exemple:

Hook: weglot_json_treat_page

Description

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

Type: Filter

Parameter: $translated_content

Declaration:

Code exemple:

Hook: weglot_html_treat_page

Description

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

Type: Filter

Parameter: $translated_content

Declaration:

Code exemple:

Hook: weglot_render_dom

Description

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

Type: Filter

Parameter: $dom

Declaration:

Code exemple:

Hook: weglot_remove_google_translate

Description

By default, Weglot plugin adds a meta tag on all translated pages: <meta name="google" content="notranslate" /> This is to prevent Google Chrome from showing google translate on translated pages. Use this filter if you want to remove this tag and still allow Google translate on translated pages.

File: ./src/actions/front/class-translate-page-weglot.php

Type: Filter

Parameter: none

Declaration:

Code exemple:

Hook: weglot_render_dom

Description

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

Type: Filter

Parameter: $dom

Declaration:

Code exemple:

Last updated