From cd085e2c9e27a2188c41cb7dc7768cfa2079ff84 Mon Sep 17 00:00:00 2001 From: Rob Skilling Date: Thu, 11 Mar 2021 16:06:01 +0000 Subject: [PATCH 1/2] Do not print tags directly into the header Because the child theme always loads before the parent theme, there is no way of over-riding this function, which means we'd always end up with a couple of GOV.UK icons in the header, and an unnecessary meta tag. These aren't required in this theme as a standalone theme, and it should be up to child themes to decide what image assets/meta tags they want in the header. --- app/Theme/Scripts.php | 12 ------------ spec/theme/scripts.spec.php | 13 ------------- 2 files changed, 25 deletions(-) diff --git a/app/Theme/Scripts.php b/app/Theme/Scripts.php index 7e33958..5508b79 100644 --- a/app/Theme/Scripts.php +++ b/app/Theme/Scripts.php @@ -13,7 +13,6 @@ public function __construct(\Dxw\Iguana\Theme\Helpers $helpers) public function register() { add_action('wp_enqueue_scripts', [$this, 'wpEnqueueScripts']); - add_action('wp_print_scripts', [$this, 'wpPrintScripts']); } public function getAssetPath($path) @@ -50,15 +49,4 @@ public function wpEnqueueScripts() wp_enqueue_style('main', $this->getAssetPath('main.min.css')); } - - public function wpPrintScripts() - { - ?> - - - - - - toBeCalled(); expect('add_action')->toBeCalled()->once()->with('wp_enqueue_scripts', [$this->scripts, 'wpEnqueueScripts']); - expect('add_action')->toBeCalled()->once()->with('wp_print_scripts', [$this->scripts, 'wpPrintScripts']); $this->scripts->register(); }); @@ -67,16 +66,4 @@ $this->scripts->wpEnqueueScripts(); }); }); - - describe('->wpPrintScripts()', function () { - it('prints some elements tags directly', function () { - allow('get_template_directory_uri')->toBeCalled()->andReturn('http://a.invalid/zzz'); - ob_start(); - $this->scripts->wpPrintScripts(); - $result = ob_get_contents(); - ob_end_clean(); - expect(preg_match_all("//", $result))->toEqual(1); - expect(preg_match_all("//", $result))->toEqual(2); - }); - }); }); From 003f1e04d48094977d9bf9176beb9182fb4caaa5 Mon Sep 17 00:00:00 2001 From: Rob Skilling Date: Thu, 11 Mar 2021 16:10:16 +0000 Subject: [PATCH 2/2] Bump to v0.2.1 --- CHANGELOG.md | 5 +++++ templates/style.css | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6909d8..31e13bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v0.2.1] - 2021-03-11 + +### Removed +- Superfluous meta tag and favicons that were printed directly into the page head, and could not be over-written. + ## [v0.2.0] - 2021-02-23 ### Added diff --git a/templates/style.css b/templates/style.css index f69ced1..92ccbe5 100644 --- a/templates/style.css +++ b/templates/style.css @@ -1,7 +1,7 @@ /* * Theme Name: GovukTheme * Author: dxw - * Version: 0.2.0 + * Version: 0.2.1 * Author URI: https://www.dxw.com/ * License: MIT * License URI: https://opensource.org/licenses/MIT