• Resolved sproutchris

    (@sproutchris)


    We need to figure out how to update the plugin to work with Timber 2.x. Timber now stores its cache files within its composer package and has discontinued usage of the WordPress plugin version of it. There is a new Timber\?Cache\?Cleaner class we can use. Docs are here.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter sproutchris

    (@sproutchris)

    Here’s a fix that worked for me. In clear-cache-for-timber.php, add the new Timber method to the clear_cache_for_timber_clear_cache() function:

    function clear_cache_for_timber_clear_cache() {
        if (class_exists('Timber\Cache\Cleaner')) {
            return Timber\Cache\Cleaner::clear_cache_twig();
        }
        else if (class_exists('Timber\\Integrations\\Command')) {
            return \Timber\Integrations\Command::clear_cache();
        }
        else {
            return TimberCommand::clear_cache();
        }
    }
    Thread Starter sproutchris

    (@sproutchris)

    Fixed for release 0.2.0.

    Hey Chris. Your plugin throws an error 500 on my class based theme setup. I’m loading Timber through composer and instantiate it like this directly in the functions.php:

    require_once( __DIR__ . '/vendor/autoload.php' );
    $timber = new Timber\Timber();

    All the other classes are loaded with autoload. Does this have an impact, or am i missing something else? Any hint would be appreciated.

    Thread Starter sproutchris

    (@sproutchris)

    @kilianso What does your error log say the 500 error is being caused by?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘doesn’t work with Timber 2.x’ is closed to new replies.