Version Description
Fixes and improvements * Hotfix for PHP versions 5.5 and 5.4
Download this release
Release Info
Developer | jarednova |
Plugin | Timber |
Version | 1.8.3 |
Comparing to | |
See all releases |
Code changes from version 1.8.2 to 1.8.3
- lib/Post.php +5 -2
- lib/Timber.php +1 -1
- readme.txt +13 -10
- timber.php +1 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +3 -3
lib/Post.php
CHANGED
@@ -1089,7 +1089,10 @@ class Post extends Core implements CoreInterface {
|
|
1089 |
/**
|
1090 |
*
|
1091 |
*/
|
1092 |
-
protected function get_revised_data_from_method( $method,
|
|
|
|
|
|
|
1093 |
$rev = $this->get_post_preview_object();
|
1094 |
if ( $rev && $this->ID == $rev->post_parent && $this->ID != $rev->ID ) {
|
1095 |
return call_user_func_array( array($rev, $method), $args );
|
@@ -1110,7 +1113,7 @@ class Post extends Core implements CoreInterface {
|
|
1110 |
* @return string
|
1111 |
*/
|
1112 |
public function content( $page = 0, $len = -1 ) {
|
1113 |
-
if ( $rd = $this->get_revised_data_from_method('content', $page, $len) ) {
|
1114 |
return $rd;
|
1115 |
}
|
1116 |
if ( $form = $this->maybe_show_password_form() ) {
|
1089 |
/**
|
1090 |
*
|
1091 |
*/
|
1092 |
+
protected function get_revised_data_from_method( $method, $args = false ) {
|
1093 |
+
if ( ! is_array($args) ) {
|
1094 |
+
$args = array($args);
|
1095 |
+
}
|
1096 |
$rev = $this->get_post_preview_object();
|
1097 |
if ( $rev && $this->ID == $rev->post_parent && $this->ID != $rev->ID ) {
|
1098 |
return call_user_func_array( array($rev, $method), $args );
|
1113 |
* @return string
|
1114 |
*/
|
1115 |
public function content( $page = 0, $len = -1 ) {
|
1116 |
+
if ( $rd = $this->get_revised_data_from_method('content', array($page, $len) ) ) {
|
1117 |
return $rd;
|
1118 |
}
|
1119 |
if ( $form = $this->maybe_show_password_form() ) {
|
lib/Timber.php
CHANGED
@@ -35,7 +35,7 @@ use Timber\Loader;
|
|
35 |
*/
|
36 |
class Timber {
|
37 |
|
38 |
-
public static $version = '1.8.
|
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.8.3';
|
39 |
public static $locations;
|
40 |
public static $dirname = 'views';
|
41 |
public static $twig_cache = false;
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: jarednova, connorjburton, lggorman
|
3 |
Tags: template engine, templates, twig
|
4 |
Requires at least: 4.7.9
|
5 |
-
Tested up to: 4.9.
|
6 |
-
Stable tag: 1.8.
|
7 |
-
PHP
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -37,8 +37,11 @@ _Twig is the template language powering Timber; if you need a little background
|
|
37 |
- Please add bullet points here with your PR. The heading for this section will get the correct version number once released.
|
38 |
|
39 |
|
40 |
-
= 1.8.
|
|
|
|
|
41 |
|
|
|
42 |
**Changes for Theme Developers**
|
43 |
- You can now change the query parameters that are used when getting a post’s terms through `$post->terms()`. #1802
|
44 |
- New attributes for responsive images `post.thumbnail.srcset` and `post.thumbnail.sizes` #1819 (thanks @maxxwv)
|
@@ -699,23 +702,23 @@ Misc fixes to documentation
|
|
699 |
== Installation ==
|
700 |
|
701 |
1. Activate the plugin through the 'Plugins' menu in WordPress
|
702 |
-
2. For an example, try modifying your home.php or index.php with something like this:
|
703 |
|
704 |
-
|
705 |
$context = array();
|
706 |
$context['message'] = 'Hello Timber!';
|
707 |
Timber::render( 'welcome.twig', $context );
|
708 |
-
|
709 |
|
710 |
Then create a subdirectory called `views` in your theme folder. Then create a file `views/welcome.twig` with these contents:
|
711 |
|
712 |
-
|
713 |
<div class="welcome">
|
714 |
<h3>{{ message }}</h3>
|
715 |
</div>
|
716 |
-
|
717 |
|
718 |
-
|
719 |
|
720 |
== Support ==
|
721 |
|
2 |
Contributors: jarednova, connorjburton, lggorman
|
3 |
Tags: template engine, templates, twig
|
4 |
Requires at least: 4.7.9
|
5 |
+
Tested up to: 4.9.8
|
6 |
+
Stable tag: 1.8.3
|
7 |
+
Requires PHP: 5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
37 |
- Please add bullet points here with your PR. The heading for this section will get the correct version number once released.
|
38 |
|
39 |
|
40 |
+
= 1.8.3 =
|
41 |
+
**Fixes and improvements**
|
42 |
+
* Hotfix for PHP versions 5.5 and 5.4
|
43 |
|
44 |
+
= 1.8.2 =
|
45 |
**Changes for Theme Developers**
|
46 |
- You can now change the query parameters that are used when getting a post’s terms through `$post->terms()`. #1802
|
47 |
- New attributes for responsive images `post.thumbnail.srcset` and `post.thumbnail.sizes` #1819 (thanks @maxxwv)
|
702 |
== Installation ==
|
703 |
|
704 |
1. Activate the plugin through the 'Plugins' menu in WordPress
|
705 |
+
2. For an example, try modifying your `home.php` or `index.php` with something like this:
|
706 |
|
707 |
+
`
|
708 |
$context = array();
|
709 |
$context['message'] = 'Hello Timber!';
|
710 |
Timber::render( 'welcome.twig', $context );
|
711 |
+
`
|
712 |
|
713 |
Then create a subdirectory called `views` in your theme folder. Then create a file `views/welcome.twig` with these contents:
|
714 |
|
715 |
+
`
|
716 |
<div class="welcome">
|
717 |
<h3>{{ message }}</h3>
|
718 |
</div>
|
719 |
+
`
|
720 |
|
721 |
+
When you visit this page, you'll see both the data from PHP come through as you've marked it up. For more, continue with the official [Getting Started Guide](https://timber.github.io/docs/getting-started/)
|
722 |
|
723 |
== Support ==
|
724 |
|
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: http://timber.upstatement.com
|
6 |
Author: Jared Novack + Upstatement
|
7 |
-
Version: 1.8.
|
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: http://timber.upstatement.com
|
6 |
Author: Jared Novack + Upstatement
|
7 |
+
Version: 1.8.3
|
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
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit1a9acfa75255d78c93ec9ed3be4ba492::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitdfecad9ee9bb796afe4d3895d7c737f7
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit1a9acfa75255d78c93ec9ed3be4ba492
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit1a9acfa75255d78c93ec9ed3be4ba492', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit1a9acfa75255d78c93ec9ed3be4ba492', 'loadClassLoader'));
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|