diff --git a/admin/qtx_admin.php b/admin/qtx_admin.php index b2f2baa..93174d9 100644 --- a/admin/qtx_admin.php +++ b/admin/qtx_admin.php @@ -119,18 +119,20 @@ function qtranxf_collect_translations_posted() { //multilingual slug/term values will be processed later if(!$edit_lang) $edit_lang = qtranxf_getLanguageEdit(); global $q_config; - $default_language = $q_config['default_language']; $default_lang = qtranxf_getLanguage(); qtranxf_regroup_translations_for('qtranslate-terms', $edit_lang, $default_lang); qtranxf_regroup_translations_for('qtranslate-slugs', $edit_lang, $default_lang); } +} +add_action('plugins_loaded', 'qtranxf_collect_translations_posted', 5); +function qtranxf_decode_translations_posted(){ //quick fix, there must be a better way - if ( isset( $_POST['nav-menu-data'] ) ) { - $r = qtranxf_decode_json_name_value(stripslashes( $_POST['nav-menu-data'] )); + if(isset($_POST['nav-menu-data'])){ + $r = qtranxf_decode_json_name_value($_POST['nav-menu-data']); //qtranxf_dbg_log('qtranxf_collect_translations_posted: $r: ', $r); if(!empty($r['qtranslate-fields'])){ - if(!$edit_lang) $edit_lang = qtranxf_getLanguageEdit(); + $edit_lang = qtranxf_getLanguageEdit(); qtranxf_collect_translations($r['qtranslate-fields'],$r,$edit_lang); unset($r['qtranslate-fields']); //qtranxf_dbg_log('qtranxf_collect_translations_posted: collected $r: ', $r); @@ -142,7 +144,7 @@ function qtranxf_collect_translations_posted() { } } } -add_action('plugins_loaded', 'qtranxf_collect_translations_posted', 5); +add_action('sanitize_comment_cookies', 'qtranxf_decode_translations_posted', 5);//after POST & GET are set, and before all WP objects are created, alternatively can use action 'setup_theme' instead. function qtranxf_admin_load() { diff --git a/readme.txt b/readme.txt index 8a9aa40..61198e3 100644 --- a/readme.txt +++ b/readme.txt @@ -98,7 +98,7 @@ Developers: please drop new topics here, the text will be moved to [qTranslate-X ## Upgrade Notice ## ### 3.4.6.6 ### -Compatibility issues with WP 4.5 +More of compatibility issues with WP 4.5 ### 3.4.6.5 ### Compatibility issues with WP 4.5 @@ -123,6 +123,7 @@ This version recovers translation of parent of a category on category edit page. ### 3.4.6.6 ### * Fix: WP45, '/wp-admin/nav-menus.php': title of newly added menu item kept one language only. +* Fix: WP45, '/wp-admin/nav-menus.php': double quotation mark in menu label. ### 3.4.6.5 ### * Improvement: Option 'Show language names in "Camel Case"' has been added on Settings/Languages page `/wp-admin/options-general.php?page=qtranslate-x#general` in order to handle absence of function `mb_convert_case`, as PHP module `mbstring` may not be installed by default: [WP Topic](https://wordpress.org/support/topic/qtranslate_utilsphp-on-line-504).