Timber - Version 0.20.5

Version Description

  • Fixed issue with sticky posts being included when just feeding an array of ids
  • Fix for pagination links with search terms (thanks @matthewsoares)
Download this release

Release Info

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

Code changes from version 0.20.4 to 0.20.5

functions/timber-helper.php CHANGED
@@ -537,6 +537,7 @@ class TimberHelper {
537
  if ( $args['add_args'] ) {
538
  $link = rtrim( add_query_arg( $args['add_args'], $link ), '/' );
539
  }
 
540
  $link = untrailingslashit( $link );
541
  $page_links[] = array(
542
  'class' => 'page-number page-numbers',
537
  if ( $args['add_args'] ) {
538
  $link = rtrim( add_query_arg( $args['add_args'], $link ), '/' );
539
  }
540
+ $link = str_replace(' ', '+', $link);
541
  $link = untrailingslashit( $link );
542
  $page_links[] = array(
543
  'class' => 'page-number page-numbers',
functions/timber-query-iterator.php CHANGED
@@ -38,7 +38,9 @@ class TimberQueryIterator implements Iterator {
38
  } elseif ( is_array( $query ) && count( $query ) && ( is_integer( $query[0] ) || is_string( $query[0] ) ) ) {
39
  // We have a list of pids (post IDs) to extract from
40
  $the_query = self::get_query_from_array_of_ids( $query );
41
-
 
 
42
  } else {
43
  TimberHelper::error_log( 'I have failed you! in ' . basename( __FILE__ ) . '::' . __LINE__ );
44
  TimberHelper::error_log( $query );
@@ -52,8 +54,10 @@ class TimberQueryIterator implements Iterator {
52
  }
53
 
54
  public function get_posts( $return_collection = false ) {
55
- $posts = new TimberPostsCollection( $this->_query->posts, $this->_posts_class );
56
- return ( $return_collection ) ? $posts : $posts->get_posts();
 
 
57
  }
58
 
59
  //
@@ -65,6 +69,7 @@ class TimberQueryIterator implements Iterator {
65
 
66
  return new WP_Query( array(
67
  'post_type'=> 'any',
 
68
  'post__in' => $query,
69
  'orderby' => 'post__in',
70
  'nopaging' => true
38
  } elseif ( is_array( $query ) && count( $query ) && ( is_integer( $query[0] ) || is_string( $query[0] ) ) ) {
39
  // We have a list of pids (post IDs) to extract from
40
  $the_query = self::get_query_from_array_of_ids( $query );
41
+ } elseif ( is_array($query) && empty($query)) {
42
+ // it's an empty array
43
+ $the_query = array();
44
  } else {
45
  TimberHelper::error_log( 'I have failed you! in ' . basename( __FILE__ ) . '::' . __LINE__ );
46
  TimberHelper::error_log( $query );
54
  }
55
 
56
  public function get_posts( $return_collection = false ) {
57
+ if (isset($this->_query->posts)){
58
+ $posts = new TimberPostsCollection( $this->_query->posts, $this->_posts_class );
59
+ return ( $return_collection ) ? $posts : $posts->get_posts();
60
+ }
61
  }
62
 
63
  //
69
 
70
  return new WP_Query( array(
71
  'post_type'=> 'any',
72
+ 'ignore_sticky_posts' => true,
73
  'post__in' => $query,
74
  'orderby' => 'post__in',
75
  'nopaging' => true
functions/timber-term.php CHANGED
@@ -60,13 +60,13 @@ class TimberTerm extends TimberCore implements TimberCoreInterface {
60
  //echo 'bad call using '.$tid;
61
  //TimberHelper::error_log(debug_backtrace());
62
  }
63
- $term->id = $term->ID;
64
- $this->import($term);
65
- if (isset($term->term_id)) {
66
- $custom = $this->get_term_meta($term->term_id);
67
- $this->import($custom);
68
- } else {
69
- //print_r($term);
70
  }
71
  }
72
 
60
  //echo 'bad call using '.$tid;
61
  //TimberHelper::error_log(debug_backtrace());
62
  }
63
+ if (isset($term->ID)){
64
+ $term->id = $term->ID;
65
+ $this->import($term);
66
+ if (isset($term->term_id)) {
67
+ $custom = $this->get_term_meta($term->term_id);
68
+ $this->import($custom);
69
+ }
70
  }
71
  }
72
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: jarednova
3
  Tags: template engine, templates, twig
4
  Requires at least: 3.7
5
- Stable tag: 0.20.4
6
- Tested up to: 3.9.1
7
  PHP version: 5.3.0 or greater
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -41,6 +41,10 @@ Timber is great for any WordPress developer who cares about writing good, mainta
41
 
42
  == Changelog ==
43
 
 
 
 
 
44
  = 0.20.4 =
45
  * Fixed issue with Timber::get_posts and Timber::query_posts using numberposts in args
46
 
2
  Contributors: jarednova
3
  Tags: template engine, templates, twig
4
  Requires at least: 3.7
5
+ Stable tag: 0.20.5
6
+ Tested up to: 4.0
7
  PHP version: 5.3.0 or greater
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
41
 
42
  == Changelog ==
43
 
44
+ = 0.20.5 =
45
+ * Fixed issue with sticky posts being included when just feeding an array of ids
46
+ * Fix for pagination links with search terms (thanks @matthewsoares)
47
+
48
  = 0.20.4 =
49
  * Fixed issue with Timber::get_posts and Timber::query_posts using numberposts in args
50
 
timber.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Timber
4
  Plugin URI: http://timber.upstatement.com
5
  Description: The WordPress Timber Library allows you to write themes using the power Twig templates
6
  Author: Jared Novack + Upstatement
7
- Version: 0.20.4
8
  Author URI: http://upstatement.com/
9
  */
10
 
4
  Plugin URI: http://timber.upstatement.com
5
  Description: The WordPress Timber Library allows you to write themes using the power Twig templates
6
  Author: Jared Novack + Upstatement
7
+ Version: 0.20.5
8
  Author URI: http://upstatement.com/
9
  */
10
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit4b58f8701289754e12436d4e4bc1df4c::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitfe0e561295ef70bd3e25dfae10c709c9::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit4b58f8701289754e12436d4e4bc1df4c
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit4b58f8701289754e12436d4e4bc1df4c
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit4b58f8701289754e12436d4e4bc1df4c', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit4b58f8701289754e12436d4e4bc1df4c', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(__DIR__);
27
  $baseDir = dirname($vendorDir);
@@ -47,7 +47,7 @@ class ComposerAutoloaderInit4b58f8701289754e12436d4e4bc1df4c
47
  }
48
  }
49
 
50
- function composerRequire4b58f8701289754e12436d4e4bc1df4c($file)
51
  {
52
  require $file;
53
  }
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitfe0e561295ef70bd3e25dfae10c709c9
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitfe0e561295ef70bd3e25dfae10c709c9', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitfe0e561295ef70bd3e25dfae10c709c9', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(__DIR__);
27
  $baseDir = dirname($vendorDir);
47
  }
48
  }
49
 
50
+ function composerRequirefe0e561295ef70bd3e25dfae10c709c9($file)
51
  {
52
  require $file;
53
  }