Skip to content

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ashhitch committed May 29, 2023
1 parent 1c89c6e commit 278d751
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ 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.4] - 2023-05-29

### Fixed

- Internal server error when querying SEO fields for a user that has no posts (#157) (thanks @pascalroget)
- woocommerce product support (#158) (thanks @berryhijwegen)

## [4.22.3] - 2023-05-29

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wp-graphql-yoast-seo",
"version": "4.22.3",
"version": "4.22.4",
"description": "A WPGraphQL Extension that adds support for Yoast SEO",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
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: 6.1.1
Requires PHP: 7.1
Stable tag: 4.22.3
Stable tag: 4.22.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down
7 changes: 3 additions & 4 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.22.3
* Version: 4.22.4
*
* @package WP_Graphql_YOAST_SEO
*/
Expand Down Expand Up @@ -842,7 +842,7 @@ function get_post_type_graphql_fields($post, array $args, AppContext $context)
return get_post_type_graphql_fields($post, $args, $context);
},
]);

// if woocommerce is active, add seo to product
if (class_exists('WooCommerce')) {
register_graphql_field('Product', 'seo', [
Expand Down Expand Up @@ -916,12 +916,11 @@ function get_post_type_graphql_fields($post, array $args, AppContext $context)
'type' => 'SEOUser',
'description' => __('The Yoast SEO data of a user', 'wp-graphql-yoast-seo'),
'resolve' => function ($user, array $args, AppContext $context) {

// Author has no posts
if (!YoastSEO()->meta->for_author($user->userId)) {
return [];
}

$robots = YoastSEO()->meta->for_author($user->userId)->robots;

$schemaArray = YoastSEO()->meta->for_author($user->userId)->schema;
Expand Down

0 comments on commit 278d751

Please sign in to comment.