Wordpress – qTranslate and Mailpress fix
Providing an ugly quick-fix to the qTranslate/Mailpress incompatability issue. But a fix none the less..
Written by Daniel, January 20, 2010
I had a problem with qTranslate and Mailpress not cooperating, and thought I’d share my quick-fix. qTranslate would wrap both title and content in it’s own syntax, and it would mess up the CMS tinymce editor.
There didn’t seem to be any solution to this at all, so I had to hack one out myself. What I quickly came up with was to comment out the wordpress function the_editor in Mailpress, and replace it with HTML.
Edit file: mailpress/mp-admin/includes/write.php, and find the following function call (around line 220-225):
the_editor((isset($draft->html)) ? $draft->html : '', 'content', 'title', apply_filters('MailPress_upload_media', false), 5);
And replace it with this:
<div id='editorcontainer'> <textarea class="theEditor" name="content" style="color:#000;width:760px;height:200px;"><?php echo $draft->html; ?></textarea> </div>
It’s extremely ugly, and the wysiwyg editor will not work, but hey.. It’s sending proper newsletters at least, and if you know enough to change this, you’ll probably know enough HTML to add your own markup to the newsletter.
I might create a prettier solution when I get more time, and/or need the function again.
I agree with you that it is awful, but it works!. I’ve seen people on the forums asking exactly how to stop qtranslate working with mailpress as a way to solve their problems. And you got it. Excellent! many thanks. When did you publish it? there is no clue… I’ll let the others know.
Comment by ubirajara — February 9, 2010 @ 5:29 pm
Hi Ubirajara! Thanks for your kind words, I’m glad you found it usefull.
I recently redesigned this site, so there’s still a few things missing.. The date has been added (I wrote this on the 20th of Jan.)
Comment by Daniel — February 9, 2010 @ 6:15 pm