WordPress.org

Support

Support » Plugins and Hacks » WP Widget Cache » [Plugin: WP Widget Cache] Polylang support

[Plugin: WP Widget Cache] Polylang support

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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?

    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.
Skip to toolbar