Repository navigation
Expand file tree
/
Copy pathacti-timber-package.php
More file actions
55 lines (46 loc) · 1.6 KB
/
Copy pathacti-timber-package.php
File metadata and controls
55 lines (46 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Plugin Name: Acti Timber Package
* Description: Ajoute des classes utiles à la conception des sites Acti sous Timber
* Version: 1.0.0
* Author: Acti
*/
use ActiTimberPackage\Handler\CapabilitiesHandler;
use ActiTimberPackage\Handler\ContextHandler;
use ActiTimberPackage\Handler\MailHandler;
use ActiTimberPackage\Handler\OptionsHandler;
use ActiTimberPackage\Handler\LoaderHandler;
use ActiTimberPackage\Handler\SvgHandler;
use ActiTimberPackage\Handler\TwigHandler;
use Timber\Timber;
add_action('muplugins_loaded', 'initActiTimberPackageProcess');
add_action('after_setup_theme', 'initActiTimberPackageSite');
function initActiTimberPackageProcess()
{
new CapabilitiesHandler();
new ContextHandler();
new OptionsHandler();
new TwigHandler();
new SvgHandler();
new MailHandler();
}
function initActiTimberPackageSite()
{
new Timber();
if (!class_exists('Timber')) {
add_action('admin_notices', function () {
echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . esc_url(admin_url('plugins.php#timber')) . '">' . esc_url(admin_url('plugins.php')) . '</a></p></div>';
});
return;
}
/**
* Sets the directories (inside your theme) to find .twig files
*/
Timber::$dirname = array('templates', 'views');
/**
* By default, Timber does NOT autoescape values. Want to enable Twig's autoescape?
* No prob! Just set this value to true
*/
Timber::$autoescape = false;
new LoaderHandler();
}