WPML
add_action( 'wpml_language_has_switched', callable $function_to_add );
Tipo
action
Versión de WPML
3.2.7

Descripción

  • Ejecute sus funciones personalizadas justo después de cambiar el idioma actual global en las consultas de WordPress.
  • Para cambiar el idioma actual, use el hook wpml_switch_language.

Argumentos

$function_to_add
(callable) (Obligatorio) Su función de devolución de llamada que se ejecutará cuando se aplique el filtro.

Ejemplo de uso

Ejemplo
function my_plugin_actions() {
  // These actions will be executed right after the global current language has just changed. 
}

add_action( 'wpml_language_has_switched', 'my_plugin_actions' );

wpml_decode_custom_field, wpml_footer_language_selector, wpml_add_language_form_field, wpml_ls_exclude_in_menu, wpml_is_rtl, wpml_alternate_hreflang, wpml_head_langs, wpml_must_translate_canonical_url, wpml_browser_redirect_language_params, wpml_active_languages

Los 29 hooks de Información de idioma de todo el sitio →