Support » Plugin: Menu Cache » Change cache time

Viewing 1 replies (of 1 total)
  • Thread Starter betagoo

    (@betagoo)

    Solution.

    function fnc_Menu_Cache()
    {
    	class Menu_Cache_Extender extends Menu_Cache
    	{
    		function __construct()
    		{
    			$this->cache_time = DAY_IN_SECONDS;
    
    			add_filter( 'wp_nav_menu',                                        array( $this, 'set_cached_menu' ), 10, 2 );
    			add_filter( 'pre_wp_nav_menu',                                    array( $this, 'get_cached_menu' ), 10, 2 );
    			add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'purge_admin_link' ) );
    			add_action( 'wp_update_nav_menu',                                 array( $this, 'refresh_cache' ) );
    			add_action( 'admin_init',                                         array( $this, 'purge_cache' ) );
    			add_action( 'plugins_loaded',                                     array( $this, 'localization' ) );
    
    		}
    	}
    	new Menu_Cache_Extender();
    }
    add_action( 'init', 'fnc_Menu_Cache');
Viewing 1 replies (of 1 total)
  • The topic ‘Change cache time’ is closed to new replies.