Add hooks for changing Twig cache path and disabling cache (for WP Engine) [MAILPOET-3157]
This commit is contained in:
@@ -54,7 +54,7 @@ class Env {
|
||||
self::$utilPath = self::$path . '/lib/Util';
|
||||
$wpUploadDir = WPFunctions::get()->wpUploadDir();
|
||||
self::$tempPath = $wpUploadDir['basedir'] . '/' . self::$pluginName;
|
||||
self::$cachePath = self::$tempPath . '/cache';
|
||||
self::$cachePath = WPFunctions::get()->applyFilters('mailpoet_template_cache_path', self::$tempPath . '/cache');
|
||||
self::$tempUrl = $wpUploadDir['baseurl'] . '/' . self::$pluginName;
|
||||
self::$languagesPath = self::$path . '/lang';
|
||||
self::$libPath = self::$path . '/lib';
|
||||
|
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class RendererFactory {
|
||||
|
||||
/** @var Renderer|null */
|
||||
@@ -9,7 +11,7 @@ class RendererFactory {
|
||||
|
||||
public function getRenderer() {
|
||||
if (!$this->renderer) {
|
||||
$caching = !WP_DEBUG;
|
||||
$caching = WPFunctions::get()->applyFilters('mailpoet_template_cache_enabled', !WP_DEBUG);
|
||||
$debugging = WP_DEBUG;
|
||||
$this->renderer = new Renderer($caching, $debugging);
|
||||
}
|
||||
|
Reference in New Issue
Block a user