WPML
wpml_ls_exclude_in_menu
Type
filter
WPML Version
4.3.12

Description

Some themes load certain menus, such as mobile menus, using AJAX. WPML does not include the language switcher in this case. This filter allows theme authors to add a language switcher to their AJAX-loaded menus.

Arguments

$isExcluded
bool Exclude the language switcher from the menu.

Example usage

Example
add_filter( 'wpml_ls_exclude_in_menu', function( $isExcluded ) {
	if ( isset( $_POST['action'] ) && 'my_ajax_load_menu_action' === $_POST['action'] ) {
		return false;
	}

	return $isExcluded;
} );

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

All 31 Site-Wide Language Information hooks