Wordpress - WYSIJA + Qtranslate simple dirty snippet that works
Hi guys, i used this solution in my last project. I just needed to get qtranslated post title and content to be inserted in e-mail template during drag & drop and here it is.
-
Open
/plugins/wysija-newsletters/controllers/ajax/campaigns.php
Around line 353 you will see:
$res['posts']=$model->query('get_res',$querystr);
after this line add:
foreach ($res['posts'] as &$translate_post) {
$translate_post{'post_title'} = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($translate_post{'post_title'});
$translate_post{'post_content'} = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($translate_post{'post_content'});
}
and you should get the contents translated according to the language currently used in the admin panel.
Written by Greg
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Wysija
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#