Tagged: wpml
Hi
I wanted to reopen a ticket but it’s closed already. The code I’ve gotten vom Ismael in the linked thread is still working but in WP debug mode I get a deprecated notice:
avia_append_lang_flags ist seit Version 4.8.2 veraltet! Benutzen Sie stattdessen Avia_WPML()->handler_append_lang_flags().
How should I modify the code?
Thanks in advance
Filz51
Hey,
Thanks for contacting us!
Could you please try changing the code to following one
//--------------------------------------------------------------
// Remove Enfold Language Switcher
//--------------------------------------------------------------
function avia_remove_main_menu_flags(){
global $avia_WPML;
add_filter( 'wp_nav_menu_items', [ new avia_WPML, 'handler_append_lang_flags' ], 9999, 2 );
remove_filter( 'wp_nav_menu_items', [ 'avia_WPML', 'handler_append_lang_flags' ], 9998, 2 );
remove_filter( 'avf_fallback_menu_items', [ 'avia_WPML', 'handler_append_lang_flags' ], 9998, 2 );
remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10 );
remove_action( 'ava_main_header_sidebar', 'avia_wpml_language_switch', 10 );
}
add_action('init','avia_remove_main_menu_flags', 9999);
Best regards,
Yigit
Hi Yigit
Thank you. The debug notice is gone now.
Best, Filz