From 63fe39a9454e0be0f7862d73b3538b22de2a082f Mon Sep 17 00:00:00 2001 From: Ashley Hitchcock Date: Sat, 11 Sep 2021 14:25:12 +0100 Subject: [PATCH] Fix canonical in taxonomies (#111) --- CHANGELOG.md | 6 ++++++ readme.txt | 2 +- wp-graphql-yoast-seo.php | 11 ++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bff34e..3825503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.15.1] - 2021-09-11 + +### Changed + +- Fix canonical url for taxonomies + ## [4.15.0] - 2021-07-15 ### Changed diff --git a/readme.txt b/readme.txt index c517b78..b081ee0 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: SEO, Yoast, WPGraphQL, GraphQL, Headless WordPress, Decoupled WordPress, J Requires at least: 5.0 Tested up to: 5.7 Requires PHP: 7.1 -Stable tag: 4.15.0 +Stable tag: 4.15.1 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/wp-graphql-yoast-seo.php b/wp-graphql-yoast-seo.php index 251d3e0..8a79165 100755 --- a/wp-graphql-yoast-seo.php +++ b/wp-graphql-yoast-seo.php @@ -8,7 +8,7 @@ * Author URI: https://www.ashleyhitchcock.com * Text Domain: wp-graphql-yoast-seo * Domain Path: /languages - * Version: 4.15.0 + * Version: 4.15.1 * * @package WP_Graphql_YOAST_SEO */ @@ -1208,8 +1208,13 @@ function wp_gql_seo_build_content_type_data($types, $all) ->load_deferred( absint($meta['wpseo_twitter-image-id']) ), - 'canonical' => isset($meta['canonical']) - ? wp_gql_seo_format_string($meta['canonical']) + 'canonical' => isset( + YoastSEO()->meta->for_term($term->term_id)->canonical + ) + ? wp_gql_seo_format_string( + YoastSEO()->meta->for_term($term->term_id) + ->canonical + ) : null, 'breadcrumbs' => YoastSEO()->meta->for_term( $term->term_id