Skip to content

Commit

Permalink
PLANET-7390: Update to Timber 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lithrel committed May 3, 2024
1 parent 38cf0a1 commit 6882d1f
Show file tree
Hide file tree
Showing 38 changed files with 363 additions and 1,154 deletions.
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

0 comments on commit 6882d1f

Please sign in to comment.