From 1daa945b6012a07f3dd90507ca658ae188a24f5d Mon Sep 17 00:00:00 2001 From: charroma <65042439+charroma@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:56:46 -0400 Subject: [PATCH] fix missing menu_items with no translation Prevent menu items being remove from menus when the term title is the same as the default language and the options "Show menu items in an alternative language when translation is not available for the selected language." is selected --- src/frontend.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend.php b/src/frontend.php index 45dfc4eb..075b613b 100644 --- a/src/frontend.php +++ b/src/frontend.php @@ -106,6 +106,9 @@ function qtranxf_wp_get_nav_menu_items( $items, $menu, $args ) { $term = wp_cache_get( $item->object_id, $item->object ); if ( $term ) { $item_title = $q_config['term_name'][ $term->name ][ $language ] ?? ''; + if ($item_title == '' && $q_config['show_menu_alternative_language']) { + $item_title = $item->title; + } if ( ! empty( $term->description ) ) { $item->description = $term->description; }