WPML

Overview of the Issue

After creating a category and translating it to another language on a site hosted on WP Engine, if you edit the category in the original language, the translation doesn’t appear immediately. You have to manually clear the object cache for the translation to appear.

Workaround

This issue is fixed in WPML 4.9. Updating solves it on your site, so you only need this workaround if you can’t update yet.

Please, make sure of having a full backup of your site before proceeding.

  • Open …/plugins/sitepress-multilingual-cms/classes/utilities/class-wpml-wp-cache.php file.
  • Look for line 108.
  • Change:
    private function get_keys() {
    	$found = false;
    	$keys  = wp_cache_get( self::KEYS, $this->group, false, $found );
    	if ( $found && is_array( $keys ) ) {
    		return $keys;
    	}
    
    	return [];
    }
  • With:
    private function get_keys() {
    	$found = false;
    	$keys  = wp_cache_get( self::KEYS, $this->group, false, $found );
    	if ( $found && is_array( $keys ) ) {
    		return $keys;
    	} else if (!$found && !empty($keys) && is_array($keys)) {
    		return $keys;
    	}
    
    	return [];
    }

All known issues

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.