Skip to content

Commit

Permalink
fix for double-quotation mark in menu item label
Browse files Browse the repository at this point in the history
  • Loading branch information
johnclause committed Apr 25, 2016
1 parent 52da9d7 commit 555db01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 7 additions & 5 deletions admin/qtx_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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).
Expand Down

0 comments on commit 555db01

Please sign in to comment.