From c25403392183d02af1421ada49681ee58bd5cfa2 Mon Sep 17 00:00:00 2001 From: Panos Paganis <mallinanga@gmail.com> Date: Sat, 28 Nov 2015 12:40:00 +0200 Subject: [PATCH] Change Timber cache location --- includes/class-nanga-third-party.php | 8 ++++++++ includes/class-nanga.php | 1 + 2 files changed, 9 insertions(+) diff --git a/includes/class-nanga-third-party.php b/includes/class-nanga-third-party.php index 2b7b006..37f9d82 100644 --- a/includes/class-nanga-third-party.php +++ b/includes/class-nanga-third-party.php @@ -202,4 +202,12 @@ public function features_json_api() { } ); } } + + public function features_timber() { + if ( class_exists( 'Timber' ) ) { + add_filter( 'timber/cache/location', function () { + return WP_CONTENT_DIR . '/cache/timber'; + } ); + } + } } diff --git a/includes/class-nanga.php b/includes/class-nanga.php index 60fe114..ad8275a 100644 --- a/includes/class-nanga.php +++ b/includes/class-nanga.php @@ -179,6 +179,7 @@ private function define_third_party() { $this->loader->add_action( 'plugins_loaded', $plugin_third_party, 'features_gravity_forms' ); $this->loader->add_action( 'plugins_loaded', $plugin_third_party, 'features_jetpack' ); $this->loader->add_action( 'plugins_loaded', $plugin_third_party, 'features_json_api' ); + $this->loader->add_action( 'plugins_loaded', $plugin_third_party, 'features_timber' ); $this->loader->add_action( 'plugins_loaded', $plugin_third_party, 'features_woocommerce' ); $this->loader->add_action( 'plugins_loaded', $plugin_third_party, 'features_wordpress_social_login' ); $this->loader->add_action( 'plugins_loaded', $plugin_third_party, 'features_wpml' );