Added some compatibility for WPML

Still more to do.
Merge remote-tracking branch 'origin/master'