• Jonas Lundman

    (@jonas-lundman)


    I am trying to: Run Postie plugin with as default WP Cron each 5 minutes. The data is saved but not showing up as a post. Not until I troubleshoot WPML and “set language information”. All posts are then “visible” in admin and front end.

    Everything works fine when WPML is deactivated, or / and postie not using Cron.

    Is there a known solution to make Postie and WPML work together?

    Thanks

    https://www.ads-software.com/plugins/postie/

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’ve same issue, how can i do that ?
    Could you please urgent help

    Thread Starter Jonas Lundman

    (@jonas-lundman)

    I don know what I did some month ago but its working now. The problem should be that WP Cron does not load all WPML protocols and the process fails/ get corrupted. Somwhere i hooked in to load / require once some WPML stuff but cant remember right now…

    Sorry

    Will come back if I found my plugin-fix.

    / Jonas Lundman

    I have the same problem. Have U found a cure ?

    // Mats

    Thread Starter Jonas Lundman

    (@jonas-lundman)

    Hi, try this in your functions.php – I THINK its all you need

    function set_WPML_language_fix($post){
    
    	// This Postie action does not need to return anything
    	// But if to use the same function elsewhere,
    	// lets return the $post object anyway!
    
    	global $sitepress;
    	if(!isset($sitepress)) return $post;
    	$id = $post['ID'];
    	$post_type = $post['post_type'];
    
    	include_once( WP_PLUGIN_DIR . '/sitepress-multilingual-cms/inc/wpml-api.php' );
    	$default_lang = $sitepress->get_default_language();
    	$_POST['icl_post_language'] = $language_code = $default_lang;
    	$trigid = wpml_get_content_trid('post_'.$post_type, $id);
    
    	$sitepress->set_element_language_details($id, 'post_'.$post_type, $trigid, $language_code);
    	return $post;
    
    }
    add_action('postie_post_after', 'set_WPML_language_fix', 10, 1);

    Thanks Jonas but that did not help. ??

    // Mats

    Hi Jonas! It works fine except post slug. Instead of slug generated from title its generate tmptitle. Any idea regarding this. Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Postie and WPML – sombody know how to get them work?’ is closed to new replies.