diff --git a/CHANGELOG.md b/CHANGELOG.md index 33ea591..d763d0b 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.22.0] - 2022-02-06 + +### Added + +- `Date archive` title and description + ## [4.21.0] - 2022-01-06 ### Added diff --git a/README.md b/README.md index ea46166..9f6304b 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,10 @@ query GetSeoConfig { description title } + date { + description + title + } config { separator } diff --git a/package.json b/package.json index 2f0f982..98a474d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wp-graphql-yoast-seo", - "version": "4.13.1", + "version": "4.22.0", "description": "A WPGraphQL Extension that adds support for Yoast SEO", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", diff --git a/readme.txt b/readme.txt index 2ae4e8e..053b03e 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: 6.1.1 Requires PHP: 7.1 -Stable tag: 4.21.0 +Stable tag: 4.22.0 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 4d39c0e..3b01301 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.21.0 + * Version: 4.22.0 * * @package WP_Graphql_YOAST_SEO */ @@ -323,6 +323,13 @@ function wp_gql_seo_build_content_type_data($types, $all) 'description' => ['type' => 'String'], ], ]); + register_graphql_object_type('SEOGlobalMetaDate', [ + 'description' => __('The Yoast SEO Date data', 'wp-graphql-yoast-seo'), + 'fields' => [ + 'title' => ['type' => 'String'], + 'description' => ['type' => 'String'], + ], + ]); register_graphql_object_type('SEOGlobalMetaConfig', [ 'description' => __('The Yoast SEO meta config data', 'wp-graphql-yoast-seo'), 'fields' => [ @@ -341,6 +348,7 @@ function wp_gql_seo_build_content_type_data($types, $all) 'fields' => [ 'homepage' => ['type' => 'SEOGlobalMetaHome'], 'author' => ['type' => 'SEOGlobalMetaAuthor'], + 'date' => ['type' => 'SEOGlobalMetaDate'], 'config' => ['type' => 'SEOGlobalMetaConfig'], 'notFound' => ['type' => 'SEOGlobalMeta404'], ], @@ -623,6 +631,10 @@ function wp_gql_seo_build_content_type_data($types, $all) 'title' => wp_gql_seo_format_string(wp_gql_seo_replace_vars($all['title-author-wpseo'])), 'description' => wp_gql_seo_format_string(wp_gql_seo_replace_vars($all['metadesc-author-wpseo'])), ]; + $date = [ + 'title' => wp_gql_seo_format_string(wp_gql_seo_replace_vars($all['title-archive-wpseo'])), + 'description' => wp_gql_seo_format_string(wp_gql_seo_replace_vars($all['metadesc-archive-wpseo'])), + ]; $config = [ 'separator' => wp_gql_seo_format_string($all['separator']), ]; @@ -636,6 +648,7 @@ function wp_gql_seo_build_content_type_data($types, $all) 'meta' => [ 'homepage' => $homepage, 'author' => $author, + 'date' => $date, 'config' => $config, 'notFound' => $notFound, ],