Skip to content

Commit

Permalink
Fix canonical in taxonomies (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashhitch authored Sep 11, 2021
1 parent 47934bf commit 63fe39a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 8 additions & 3 deletions wp-graphql-yoast-seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 63fe39a

Please sign in to comment.