-
-
Notifications
You must be signed in to change notification settings - Fork 506
/
timber.php
23 lines (23 loc) · 1.05 KB
/
timber.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/*
Plugin Name: Timber
Description: The WordPress Timber Library allows you to write themes using the power of Twig templates.
Plugin URI: https://upstatement.com/timber
Author: Jared Novack + Upstatement
Version: 1.22.0
Author URI: http://upstatement.com/
Requires PHP: 7.2.5
Requires at least: 5.3.0
*/
// we look for Composer files first in the plugins dir.
// then in the wp-content dir (site install).
// and finally in the current themes directories.
if ( file_exists( $composer_autoload = __DIR__ . '/vendor/autoload.php' ) /* check in self */
|| file_exists( $composer_autoload = WP_CONTENT_DIR.'/vendor/autoload.php') /* check in wp-content */
|| file_exists( $composer_autoload = plugin_dir_path( __FILE__ ).'vendor/autoload.php') /* check in plugin directory */
|| file_exists( $composer_autoload = get_stylesheet_directory().'/vendor/autoload.php') /* check in child theme */
|| file_exists( $composer_autoload = get_template_directory().'/vendor/autoload.php') /* check in parent theme */
) {
require_once $composer_autoload;
}
new \Timber\Timber;