Enable qTranslate for WordPress 4

Seems like qTranslate is not really updated anymore or at least it is updated very slowly. So when I updated WordPress to new version I got this message and qTranslate editor in admin was disabled.

The qTranslate Editor has disabled itself because it hasn’t been tested with your WordPress version yet. This is done to prevent WordPress from malfunctioning. You can reenable it by clicking here (may cause data loss! Use at own risk!). To remove this message permanently, please update qTranslate to the corresponding version.

I guess the easiest way is to just click on the link and it will probably enable itself. I googled it and it seems some people might have problems with that. So the solution that worked for most people is this:

First, open wp-content/plugins/qtranslate/qtranslate.php file and change line 90 from

define('QT_SUPPORTED_WP_VERSION', '3.7.1');

to

define('QT_SUPPORTED_WP_VERSION', '4.0');

just save it and that’s it.

Of course if WordPress is updated to new version qTranslate will disable itself again. What you can do is enable it for all version by dynamically inserting current WordPress version, like this

define('QT_SUPPORTED_WP_VERSION', get_bloginfo('version'));

qTranslate will now work for all (future) versions of WordPress.

Hint: You can find out your WordPress version on the bottom right in the admin or by opening a file /wp-includes/version.php and checking the $wp_version variable on the top.

Note: Do this on your own risk. It seems to work for most people but beware you might loose your data if something goes wrong. The safest way is to wait for author of qTranslate to update it but it seems this is not happening.