Title: [Plugin: WP Widget Cache] Polylang support
Last modified: August 20, 2016

---

# [Plugin: WP Widget Cache] Polylang support

 *  [QuickeneR](https://wordpress.org/support/users/quickener/)
 * (@quickener)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-widget-cache-polylang-support/)
 * Same as suggested in this thread by DSmidge, adjusted for polylang
    [http://wordpress.org/support/topic/plugin-wp-widget-cache-feature-request-support-for-qtranslate?replies=4](http://wordpress.org/support/topic/plugin-wp-widget-cache-feature-request-support-for-qtranslate?replies=4)
 *     ```
       --- widget-cache.php.org	2012-10-09 18:36:17.000000000 +0600
       +++ widget-cache.php	2012-10-09 18:38:55.000000000 +0600
       @@ -503,7 +503,7 @@
        		{
        			echo "<!--$this->plugin_name $this->plugin_version ($this->plugin_uri) Begin -->\n";
   
       -			while($this->wcache->save($this->get_widget_cache_key($id), $wc_value, array(), $id) || ($this->widget_cache_getcache($id, $wc_value) && false))
       +			while ($this->wcache->save( pll_current_language() . $this->get_widget_cache_key($id), $wc_value, array(), $id) || ($this->widget_cache_getcache($id, $wc_value) && false ) )
        			{
        				call_user_func_array($callback, $params);
        			}
       ```
   
 * [http://wordpress.org/extend/plugins/wp-widget-cache/](http://wordpress.org/extend/plugins/wp-widget-cache/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/plugin-wp-widget-cache-polylang-support/#post-3107105)
 * Wow. I came to this forum to make mention of the incompatibility between Polylang
   and WP Widget Cache, just to find there is a patch. Great! but…
 * Any chance this will make it into WP Widget Cache? And if not, can I request 
   a filter where we can hook into with some extra code to make the two plugins 
   play nice without running any customised versions?
 *  [leoloso](https://wordpress.org/support/users/leoloso/)
 * (@leoloso)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-widget-cache-polylang-support/#post-3107117)
 * Yes, this would be the best, let’s hope the author adds a filter. Something as
   simple as:
 *     ```
       apply_filters('widget_cache_key_id', $this->get_widget_cache_key($id))
       ```
   
 * Then we can implement a solution in our functions.php: when using qTranslate,
   we just do this:
 *     ```
       add_filter("widget_cache_key_id", "widgetcache_qtrans_lang");
       function widgetcache_qtrans_lang($id) {
   
       	return $id . '-' . qtrans_getLanguage();
       }
       ```
   
 * And for Polylang:
 *     ```
       add_filter("widget_cache_key_id", "widgetcache_poly_lang");
       function widgetcache_poly_lang($id) {
   
       	return $id . '-' . pll_current_language();
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: WP Widget Cache] Polylang support’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-widget-cache.svg)
 * [WP Widget Cache](https://wordpress.org/plugins/wp-widget-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-widget-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-widget-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-widget-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-widget-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-widget-cache/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [leoloso](https://wordpress.org/support/users/leoloso/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-widget-cache-polylang-support/#post-3107117)
 * Status: not resolved