Title: TypeError: hook is undefined
Last modified: August 30, 2016

---

# TypeError: hook is undefined

 *  [vokopeti](https://wordpress.org/support/users/vokopeti/)
 * (@vokopeti)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/typeerror-hook-is-undefined/)
 * I’ve got an consol error ‘TypeError: hook is undefined’ in Firebug and the editor
   does not load eiter the translation tabs. The content just contains the qTranslate
   formatted strings: <!–:hu–>Kapcsolat<!–:–><!–:en–>Contact<!–:–><!–:de–>Verbindung
   <!–:–><!–:it–>Contatti<!–:–>
 * [https://wordpress.org/plugins/qtranslate-x/](https://wordpress.org/plugins/qtranslate-x/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/typeerror-hook-is-undefined/#post-6303688)
 * Does it happen under standard Wp with qtx the only plugin? If not, look for a
   conflicting plugin.
 *  Thread Starter [vokopeti](https://wordpress.org/support/users/vokopeti/)
 * (@vokopeti)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/typeerror-hook-is-undefined/#post-6303750)
 * Hi John,
 * Thank you for your quick reply!
    Yes, I’ve disabled all the plugins but qtx and
   it still does not load the editor either on WordPress 4.2.2. I’ve uploaded some
   screengrabs for you. If you could help me that would be great!
 * Thank you!
    Peter
 * [http://oi60.tinypic.com/imq9g5.jpg](http://oi60.tinypic.com/imq9g5.jpg)
    [http://oi58.tinypic.com/2ah8y3c.jpg](http://oi58.tinypic.com/2ah8y3c.jpg)
   [http://oi61.tinypic.com/a2rm39.jpg](http://oi61.tinypic.com/a2rm39.jpg)
 *     ```
       <script type="text/javascript">
       // <![CDATA[
   
       (function() {
       	for (var i in tinyMCEPreInit.qtInit) {
       		var tmp = tinyMCEPreInit.qtInit[i];
       		tmp.id = 'ppqtrans_textarea_'+tmp.id;
   
       		tinyMCEPreInit.qtInit[tmp.id] = tmp;
       		delete tinyMCEPreInit.qtInit[i];
       		jQuery('#ed_toolbar').hide();
       	}
   
       /// THE hook VARIABLE SEEMS TO BE UNDEFINED FOR SOME REASON!
   
       	var hook = tinyMCEPreInit.mceInit['content'];
       	hook.elements='hook-to-nothing';
   
       	hook.selector = '#ppqtrans_textarea_content';
       	delete tinyMCEPreInit.mceInit['content'];
       			tinyMCEPreInit.mceInit['ppqtrans_textarea_content'] = hook;
   
       	var wrap = jQuery('#wp-content-wrap');
       	var html = '<div id="wp-ppqtrans_textarea_content-wrap" class="' + wrap.prop('className') + '"></div>';
       	jQuery('body').append(html);
       		}());
       </script>
       ```
   
 *  [byzgl](https://wordpress.org/support/users/byzgl/)
 * (@byzgl)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/typeerror-hook-is-undefined/#post-6303960)
 * Replace:
    var html = ‘<div id=”wp-ppqtrans_textarea_content-wrap” class=”‘ + 
   wrap.prop(‘className’) + ‘”></div>’;
 * to this:
 *  var html = ‘<div id=\”wp-ppqtrans_textarea_content-wrap\” class=\”‘ + wrap.prop(‘
   className’) + ‘\”></div>’;

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘TypeError: hook is undefined’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/qtranslate-x_f9f9f9.svg)
 * [qTranslate X](https://wordpress.org/plugins/qtranslate-x/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/qtranslate-x/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/qtranslate-x/)
 * [Active Topics](https://wordpress.org/support/plugin/qtranslate-x/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/qtranslate-x/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/qtranslate-x/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [byzgl](https://wordpress.org/support/users/byzgl/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/typeerror-hook-is-undefined/#post-6303960)
 * Status: not resolved