Tag : qTranslate

4 years, 5 months ago 0

WordPress allows you to use custom text editors with the function wp_editor. There is one very annoying issue, which is cause in combination with qTranslate plugin. It means, while you are using qTranslate and in the same time for example in admin you have custom wp_editor ‘s, you are not able to insert any files (uploads neither images) in the wp_editor.

There is fix available. Editing file

[YOUR_SITE_ROOT]/wp-content/plugins/qtranslate/qtranslate_javascript.php

and make the block on line 238 look following:

$q_config['js']['qtrans_wpActiveEditorOverload'] = "
	jQuery('.wp-editor-wrap').unbind('mousedown');
	jQuery('.wp-editor-wrap').mousedown(function(e){
		/*wpActiveEditor = 'qtrans_textarea_'+this.id.slice(3, -5);*/
		 var sliced = this.id.slice(3, -5);
            if (sliced == 'content'){
 	            wpActiveEditor = 'qtrans_textarea_content';
            } else {
                wpActiveEditor = sliced;
            }
});
";