• I had some problems with wrong language versions of events showing up in the public calendar (using WPML). After a long time of searching, I found that the (object) caching seemed to be the problem since it didn’t consider the language.

    My fix in event-organiser-ajax.php, around line 100:

    //In case WPML is enabled. Include locale in cache key.
    	$wpml_code = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : '';
    
    	//In case polylang is enabled with events as translatable. Include locale in cache key.
    	$options = get_option( 'polylang' );
    	if( defined( 'POLYLANG_VERSION' ) && !empty( $options['post_types']  ) && in_array( 'event', $options['post_types'] ) ){
    		$key = 'eo_fc_'.md5( serialize( $query ). $time_format . $wpml_code . get_locale() );
    	}else{
    		$key = 'eo_fc_'.md5( serialize( $query ). $time_format . $wpml_code );
    	}

    I hope it can be implemented in the plugin.

    https://www.ads-software.com/plugins/event-organiser/

  • The topic ‘Suggested fix for use with WPML’ is closed to new replies.