mirror of
https://github.com/gantry/gantry5.git
synced 2026-08-19 01:15:04 -05:00
remove conditional tags for calling page_head file, add minimum required version of Gantry to hydrogen with notices, updated changelog
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
# 5.2.1
|
||||
## XX/XX/XXXX
|
||||
|
||||
1. [Common](#common)
|
||||
2. [Joomla](#joomla)
|
||||
3. [WordPress](#wordpress)
|
||||
1. [](#new)
|
||||
- Hydrogen now requires Gantry 5.2.0 or higher and will display a notice if theme requirements aren't met
|
||||
2. [](#improved)
|
||||
- Removed Hydrogen conditional tags for loading page_head.html.twig file
|
||||
|
||||
# 5.2.0
|
||||
## 29/10/2015
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@ $theme->setLayout('_error', true);
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
Timber::render('404.html.twig', $context);
|
||||
|
||||
@@ -24,7 +24,7 @@ $theme = $gantry['theme'];
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
$templates = ['archive.html.twig', 'index.html.twig'];
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ $theme = $gantry['theme'];
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
$context['posts'] = Timber::get_posts();
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ $theme = $gantry['theme'];
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
$context['posts'] = Timber::query_post();
|
||||
$context['content'] = TimberHelper::ob_function('the_content');
|
||||
|
||||
@@ -19,7 +19,7 @@ $theme = $gantry['theme'];
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
$context['posts'] = Timber::query_post();
|
||||
$context['content'] = TimberHelper::ob_function('the_content');
|
||||
|
||||
@@ -15,6 +15,22 @@ defined('ABSPATH') or die;
|
||||
// Bootstrap Gantry framework or fail gracefully.
|
||||
$gantry = include_once dirname(__FILE__) . '/includes/gantry.php';
|
||||
|
||||
// Check min. required version of Gantry 5
|
||||
$requiredGantryVersion = '5.2.0';
|
||||
|
||||
if (!$gantry->isCompatible($requiredGantryVersion)) {
|
||||
$current_theme = wp_get_theme();
|
||||
$error = sprintf(__('Please upgrade Gantry 5 Framework to v%s (or later) before using %s theme!', 'g5_requiem'), strtoupper($requiredGantryVersion), $current_theme->get('Name'));
|
||||
|
||||
if(is_admin()) {
|
||||
add_action('admin_notices', function () use ($error) {
|
||||
echo '<div class="error"><p>' . $error . '</p></div>';
|
||||
});
|
||||
} else {
|
||||
wp_die($error);
|
||||
}
|
||||
}
|
||||
|
||||
/** @var \Gantry\Framework\Theme $theme */
|
||||
$theme = $gantry['theme'];
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ $theme = $gantry['theme'];
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
$GLOBALS['timberContext'] = $context;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ $theme = $gantry['theme'];
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
$context['posts'] = Timber::get_posts();
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@ $theme->setLayout('_offline', true);
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
Timber::render('offline.html.twig', $context);
|
||||
|
||||
@@ -31,7 +31,7 @@ $theme = $gantry['theme'];
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
$post = Timber::query_post();
|
||||
$context['post'] = $post;
|
||||
|
||||
@@ -19,7 +19,7 @@ $theme = $gantry['theme'];
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
$context['title'] = __('Search results for:', 'g5_hydrogen') . ' ' . get_search_query();
|
||||
$context['posts'] = Timber::get_posts();
|
||||
|
||||
@@ -19,7 +19,7 @@ $theme = $gantry['theme'];
|
||||
|
||||
// We need to render contents of <head> before plugin content gets added.
|
||||
$context = Timber::get_context();
|
||||
$context['page_head'] = $gantry->isCompatible('5.1.5') ? $theme->render('partials/page_head.html.twig', $context) : null;
|
||||
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
|
||||
|
||||
$post = Timber::query_post();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user