[+] Prevent automatic menu translation by WPML when not translated in other languages

Since WPML 4.5 menu items are translated to other languages automatically (on the fly) if the translation of items (page, post, CPT) exists in secondary languages and the menu is not translated.

Some customer wants to get rid of this behavior which is not possible at the moment. Instead, you can use the workaround. Add this code to theme functions.php and add the locations name in $locations_to_omit

$locations_to_omit = ['primary']; //Append menu locations here. e.g. ['primary', 'footer']
add_filter('wp_nav_menu_args', function ($args) use ($locations_to_omit) {
	if (isset($args['theme_location']) && in_array($args['theme_location'], $locations_to_omit)) {
		$current_lang = apply_filters( 'wpml_current_language', null );
		do_action('wpml_switch_language', apply_filters( 'wpml_default_language', null ));
		
		add_filter('wp_nav_menu', function ($nav_menu) use ($current_lang){
			do_action('wpml_switch_language', $current_lang);
			return $nav_menu;
		}, 99);
	}
	
	return $args;
}, 1);

Bring back old Toolset Menu, and have Layouts Edit Button as well if layouts is assigned to content

The Toolset Menu in the Front End WP Admin Bar, if Layouts is assigend to the content, becomes leads to the Front End Editor of layouts.
You cannot access other Toolset items with it anymore.

Often Clients have nested Views and to quickly access them, the old menu was perfect.
The new way will introduce a lot of time wasted clicking around in the admin.

To those clients we can provide a filter that brings back the old Toolset Menu.

It is also very useful for debugging.

add_filter('toolset_filter_toolset_admin_bar_menu_disable', 'my_layout_menu');
function my_layout_menu(){
	return false;
}