function avia_remove_main_menu_flags(){
remove_filter( ‘wp_nav_menu_items’, ‘avia_append_lang_flags’, 20, 2 );
remove_filter( ‘avf_fallback_menu_items’, ‘avia_append_lang_flags’, 20, 2 );
remove_action( ‘avia_meta_header’, ‘avia_wpml_language_switch’, 10);
}
function wpml_filter_langs( $languages ) {
foreach ( $languages as $k => $language ) {
$lang_code = explode ( ‘-‘ , $languages[$k][‘language_code’] );
$languages[$k][‘native_name’] = ucfirst( $lang_code[0] );
$languages[$k][‘translated_name’] = ucfirst( $lang_code[0] );
}
return $languages;
}
add_filter( ‘icl_ls_languages’, ‘wpml_filter_langs’ );
After the last update no longer works add_filter to open the automatic menu of wpml you can help me this code that I worked that has always worked:
Displays the traditional menu of the theme and displays only in the mobile menu