Timber - Version 1.18.1

Version Description

Fixes and improvements

  • Corrects an issue where #2305 tested for arrays but not other Iterables (like Timber\PostCollections) #2314 (thanks @nlemoine)
Download this release

Release Info

Developer jarednova
Plugin Icon 128x128 Timber
Version 1.18.1
Comparing to
See all releases

Code changes from version 1.18.0 to 1.18.1

lib/Helper.php CHANGED
@@ -174,7 +174,7 @@ class Helper {
174
  /**
175
  * @codeCoverageIgnore
176
  * @deprecated since 1.3.0
177
- *
178
  * @param mixed $function_name String or array( $class( string|object ), $function_name ).
179
  * @param array $defaults Optional.
180
  * @param bool $return_output_buffer Optional. Return function output instead of return value. Default false.
@@ -441,7 +441,12 @@ class Helper {
441
  return self::wp_list_filter( $list, $arrow, $operator );
442
  }
443
 
444
- return array_filter( $list, $arrow, \ARRAY_FILTER_USE_BOTH );
 
 
 
 
 
445
  }
446
 
447
  /**
174
  /**
175
  * @codeCoverageIgnore
176
  * @deprecated since 1.3.0
177
+ *
178
  * @param mixed $function_name String or array( $class( string|object ), $function_name ).
179
  * @param array $defaults Optional.
180
  * @param bool $return_output_buffer Optional. Return function output instead of return value. Default false.
441
  return self::wp_list_filter( $list, $arrow, $operator );
442
  }
443
 
444
+ if ( is_array( $list ) ) {
445
+ return array_filter( $list, $arrow, \ARRAY_FILTER_USE_BOTH );
446
+ }
447
+
448
+ // the IteratorIterator wrapping is needed as some internal PHP classes are \Traversable but do not implement \Iterator
449
+ return new \CallbackFilterIterator( new \IteratorIterator( $list ), $arrow );
450
  }
451
 
452
  /**
lib/Timber.php CHANGED
@@ -35,7 +35,7 @@ use Timber\Loader;
35
  */
36
  class Timber {
37
 
38
- public static $version = '1.18.0';
39
  public static $locations;
40
  public static $dirname = 'views';
41
  public static $twig_cache = false;
35
  */
36
  class Timber {
37
 
38
+ public static $version = '1.18.1';
39
  public static $locations;
40
  public static $dirname = 'views';
41
  public static $twig_cache = false;
readme.txt CHANGED
@@ -38,6 +38,12 @@ _Twig is the template language powering Timber; if you need a little background
38
 
39
  **Fixes and improvements**
40
 
 
 
 
 
 
 
41
  = 1.18.0 =
42
 
43
  **Changes for Theme Developers**
@@ -46,7 +52,7 @@ _Twig is the template language powering Timber; if you need a little background
46
 
47
  **Fixes and improvements**
48
 
49
- * Fixes an error with array_filter and later versions of Twig
50
 
51
  = 1.17.0 =
52
 
38
 
39
  **Fixes and improvements**
40
 
41
+ = 1.18.1 =
42
+
43
+ **Fixes and improvements**
44
+
45
+ * Corrects an issue where #2305 tested for arrays but not other Iterables (like `Timber\PostCollection`s) #2314 (thanks @nlemoine)
46
+
47
  = 1.18.0 =
48
 
49
  **Changes for Theme Developers**
52
 
53
  **Fixes and improvements**
54
 
55
+ * Fixes an error with array_filter and later versions of Twig #2305
56
 
57
  = 1.17.0 =
58
 
timber-starter-theme/README.md CHANGED
@@ -1,9 +1,8 @@
1
-
2
  # The Timber Starter Theme
3
 
4
  The "_s" for Timber: a dead-simple theme that you can build from. The primary purpose of this theme is to provide a file structure rather than a framework for markup or styles. Configure your Sass, scripts, and task runners however you would like!
5
 
6
- [![Build Status](https://travis-ci.org/timber/starter-theme.svg)](https://travis-ci.org/timber/starter-theme)
7
 
8
  ## Installing the Theme
9
 
 
1
  # The Timber Starter Theme
2
 
3
  The "_s" for Timber: a dead-simple theme that you can build from. The primary purpose of this theme is to provide a file structure rather than a framework for markup or styles. Configure your Sass, scripts, and task runners however you would like!
4
 
5
+ [![Build Status](https://travis-ci.com/timber/starter-theme.svg?branch=master)](https://travis-ci.com/github/timber/starter-theme)
6
 
7
  ## Installing the Theme
8
 
timber.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Timber
4
  Description: The WordPress Timber Library allows you to write themes using the power of Twig templates.
5
  Plugin URI: https://upstatement.com/timber
6
  Author: Jared Novack + Upstatement
7
- Version: 1.18.0
8
  Author URI: http://upstatement.com/
9
  */
10
  // we look for Composer files first in the plugins dir.
4
  Description: The WordPress Timber Library allows you to write themes using the power of Twig templates.
5
  Plugin URI: https://upstatement.com/timber
6
  Author: Jared Novack + Upstatement
7
+ Version: 1.18.1
8
  Author URI: http://upstatement.com/
9
  */
10
  // we look for Composer files first in the plugins dir.
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit6e6ec7fe550de6e5d6cd2ebfac561624::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit7c91bbb73b7b38d67cc012492962d7a4::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit6e6ec7fe550de6e5d6cd2ebfac561624
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit6e6ec7fe550de6e5d6cd2ebfac561624
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit6e6ec7fe550de6e5d6cd2ebfac561624', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit6e6ec7fe550de6e5d6cd2ebfac561624', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit6e6ec7fe550de6e5d6cd2ebfac561624::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit6e6ec7fe550de6e5d6cd2ebfac561624
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit6e6ec7fe550de6e5d6cd2ebfac561624::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire6e6ec7fe550de6e5d6cd2ebfac561624($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire6e6ec7fe550de6e5d6cd2ebfac561624($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit7c91bbb73b7b38d67cc012492962d7a4
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit7c91bbb73b7b38d67cc012492962d7a4', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit7c91bbb73b7b38d67cc012492962d7a4', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit7c91bbb73b7b38d67cc012492962d7a4::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit7c91bbb73b7b38d67cc012492962d7a4::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire7c91bbb73b7b38d67cc012492962d7a4($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire7c91bbb73b7b38d67cc012492962d7a4($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit6e6ec7fe550de6e5d6cd2ebfac561624
8
  {
9
  public static $files = array (
10
  '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@@ -618,11 +618,11 @@ class ComposerStaticInit6e6ec7fe550de6e5d6cd2ebfac561624
618
  public static function getInitializer(ClassLoader $loader)
619
  {
620
  return \Closure::bind(function () use ($loader) {
621
- $loader->prefixLengthsPsr4 = ComposerStaticInit6e6ec7fe550de6e5d6cd2ebfac561624::$prefixLengthsPsr4;
622
- $loader->prefixDirsPsr4 = ComposerStaticInit6e6ec7fe550de6e5d6cd2ebfac561624::$prefixDirsPsr4;
623
- $loader->fallbackDirsPsr4 = ComposerStaticInit6e6ec7fe550de6e5d6cd2ebfac561624::$fallbackDirsPsr4;
624
- $loader->prefixesPsr0 = ComposerStaticInit6e6ec7fe550de6e5d6cd2ebfac561624::$prefixesPsr0;
625
- $loader->classMap = ComposerStaticInit6e6ec7fe550de6e5d6cd2ebfac561624::$classMap;
626
 
627
  }, null, ClassLoader::class);
628
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit7c91bbb73b7b38d67cc012492962d7a4
8
  {
9
  public static $files = array (
10
  '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
618
  public static function getInitializer(ClassLoader $loader)
619
  {
620
  return \Closure::bind(function () use ($loader) {
621
+ $loader->prefixLengthsPsr4 = ComposerStaticInit7c91bbb73b7b38d67cc012492962d7a4::$prefixLengthsPsr4;
622
+ $loader->prefixDirsPsr4 = ComposerStaticInit7c91bbb73b7b38d67cc012492962d7a4::$prefixDirsPsr4;
623
+ $loader->fallbackDirsPsr4 = ComposerStaticInit7c91bbb73b7b38d67cc012492962d7a4::$fallbackDirsPsr4;
624
+ $loader->prefixesPsr0 = ComposerStaticInit7c91bbb73b7b38d67cc012492962d7a4::$prefixesPsr0;
625
+ $loader->classMap = ComposerStaticInit7c91bbb73b7b38d67cc012492962d7a4::$classMap;
626
 
627
  }, null, ClassLoader::class);
628
  }