<commit_before><?php
/*
Plugin Name: Timber
Plugin URI: http://timber.upstatement.com
Description: The WordPress Timber Library allows you to write themes using the power Twig templates
Author: <NAME> + Upstatement
Version: 0.21.1
Author URI: http://upstatement.com/
*/

global $wp_version;
global $timber;

// we look for Composer files first in the theme (theme install)
// then in the wp-content dir (site install)
if (    file_exists( $composer_autoload = __DIR__ . '/vendor/autoload.php' )
	|| file_exists( $composer_autoload = WP_CONTENT_DIR.'/vendor/autoload.php' ) ) {
	require_once $composer_autoload;
}

$timber = new Timber();
Timber::$dirname = 'views';

/** Usage:
 *
 *  $posts = Timber::get_posts();
 *  $posts = Timber::get_posts('post_type = article')<commit_msg>update: made available three different autoload dirs, includes themes folder<commit_after><?php
/*
Plugin Name: Timber
Plugin URI: http://timber.upstatement.com
Description: The WordPress Timber Library allows you to write themes using the power Twig templates
Author: <NAME> + Upstatement
Version: 0.21.1
Author URI: http://upstatement.com/
*/

global $wp_version;
global $timber;

// we look for Composer files first in the plugins dir
// then in the wp-content dir (site install)
// and finally in the current themes directory
if (   file_exists( $composer_autoload = __DIR__ . '/vendor/autoload.php' )
	|| file_exists( $composer_autoload = WP_CONTENT_DIR.'/vendor/autoload.php')
	|| file_exists( $composer_autoload = get_template_directory().'/vendor/autoload.php')) {
	require_once $composer_autoload;
}

$timber = new Timber();
Timber::$dirname = 'views';

/** Usage:
 *
 *  $posts = Timber::get_posts();
 *  $posts = Timber::get_posts('post_type = article')
{'fraction_non_alphanumeric': 0.13073394495412843, 'fraction_numerical': 0.0045871559633027525, 'mean_word_length': 4.855704697986577, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6380260', 'n_tokens_mistral': 576, 'n_tokens_neox': 572, 'n_words': 163}