That is very strange as the same code runs in both cases. Do you mind sharing the addon you’ve created? Please email [email protected]
Hello,
this is my filterpostie.php
add_filter('postie_post_after', 'add_def_lang');
function add_def_lang($post) {
$link = mysql_connect(':/var/run/mysqld/mysqld.sock', 'wordpress', '*******');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('wordpress', $link) or die('Could not select database.');
$res = mysql_query('INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUE ('.$post['ID'].',"_wplp_post_front",1)');
$res = mysql_query('INSERT INTO wp_ceceppa_ml_posts (cml_post_lang_1,cml_post_id_1,cml_post_lang_2,cml_post_id_2) VALUE (1,'.$post['ID'].',0,0)');
$res = mysql_query('UPDATE wp_options SET option_value=1 WHERE option_name="cml_page_lang_'.$post['ID'].'"');
mysql_close();
return $post;
}
the multilanguage plugin is http://ww.wp.xz.cn/plugins/ceceppa-multilingua/
Thank you
-max
Hello,
I found that the problem was related to the other plugin.
Today I got an update from the developer, with a dedicated function that works with both Postie debug and get_mail.php.
function add_def_lang($post) {
if(function_exists('cml_set_language_of_post')) {
$lang = 1;
cml_set_language_of_post( $post['ID'], $lang );
EchoInfo('Post ID: '.$post['ID'].' Language set to: '.$lang);
}
return $post;
}
Regards
-max
i have same problema, but i using filterpostie.ph but not work with cron,
if i run posti manual all ok, but if i run automatic with cron the new post don’t have set language…
can you help me?
If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else’s topic.
I am now closing this 9 month old resolved topic as it references an older version of WordPress.