Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLANET-7390: Update to Timber 2.1 #2280

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
/**
* The template for displaying 404 pages (Not Found)
*
* Methods for TimberHelper can be found in the /functions sub-directory
* Methods for \Timber\Helper can be found in the /functions sub-directory
*
* @package WordPress
* @subpackage Timber
* @since Timber 0.1
*/

$context = Timber::get_context();
$context = Timber::context();

$options = get_option('planet4_options');
$context['page_notfound_image'] = $options['404_page_bg_image']
Expand Down
2 changes: 1 addition & 1 deletion archive-p4_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

$templates = [ 'all-actions.twig', 'archive.twig', 'index.twig' ];

$context = Timber::get_context();
$context = Timber::context();

$context['custom_body_classes'] = 'tax-p4-page-type';
$context['header_title'] = post_type_archive_title('', false);
Expand Down
4 changes: 2 additions & 2 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* Methods for TimberHelper can be found in the /lib sub-directory
* Methods for \Timber\Helper can be found in the /lib sub-directory
*
* @package WordPress
* @subpackage Timber
Expand All @@ -19,7 +19,7 @@

$templates = [ 'archive.twig', 'index.twig' ];

$context = Timber::get_context();
$context = Timber::context();

$context['title'] = 'Archive';
if (is_day()) {
Expand Down
7 changes: 3 additions & 4 deletions author.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@
/**
* The template for displaying Author Archive pages
*
* Methods for TimberHelper can be found in the /lib sub-directory
* Methods for \Timber\Helper can be found in the /lib sub-directory
*
* @package WordPress
* @subpackage Timber
* @since Timber 0.1
*/

use P4\MasterTheme\User;
use P4\MasterTheme\Post;
use P4\MasterTheme\ListingPage;
use Timber\Timber;

$context = Timber::get_context();
$context = Timber::context();

if (isset($wp_query->query_vars['author'])) {
$author = new User($wp_query->query_vars['author']);
$author = Timber::get_user($wp_query->query_vars['author']);
$context['author'] = $author;
$context['title'] = 'Author Archives: ' . $author->name();

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"phpunit/phpunit": "^7.5||^9.5",
"yoast/phpunit-polyfills": "^1.1.0",
"doctrine/instantiator": "^1.5.0",
"timber/timber": "1.24.0"
"timber/timber": "2.1.*"
},
"scripts": {
"fixes": "vendor/bin/phpcbf",
Expand Down
Loading