Skip to content

Commit

Permalink
Version Bump 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ashhitch committed Jan 8, 2021
1 parent b91fa09 commit eaa170e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 22 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.11.0] - 2021-01-08

### Changed

- Updated deprecated deprecated function changed in WPGraphQL v1.1.0 (thanks @jasonbahl)

## [4.10.2] - 2020-12-22

### Added
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.4
Requires PHP: 7.1
Stable tag: 4.10.2
Stable tag: 4.11.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down
72 changes: 51 additions & 21 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.10.2
* Version: 4.11.0
*
* @package WP_Graphql_YOAST_SEO
*/
Expand Down Expand Up @@ -611,9 +611,19 @@ function wp_gql_seo_build_content_type_data($types, $all)
'personName' => wp_gql_seo_format_string(
$user->user_nicename
),
'companyLogo' => $context->get_loader('post')->load_deferred( absint( $all['company_logo_id'] ) ),
'personLogo' => $context->get_loader('post')->load_deferred( absint( $all['person_logo_id'] ) ),
'logo' => $context->get_loader('post')->load_deferred( $all['company_or_person'] === 'company' ? absint( $all['company_logo_id'] ) : absint( $all['person_logo_id'] ) ),
'companyLogo' => $context
->get_loader('post')
->load_deferred(absint($all['company_logo_id'])),
'personLogo' => $context
->get_loader('post')
->load_deferred(absint($all['person_logo_id'])),
'logo' => $context
->get_loader('post')
->load_deferred(
$all['company_or_person'] === 'company'
? absint($all['company_logo_id'])
: absint($all['person_logo_id'])
),
'companyOrPerson' => wp_gql_seo_format_string(
$all['company_or_person']
),
Expand All @@ -630,15 +640,21 @@ function wp_gql_seo_build_content_type_data($types, $all)
],
'redirects' => array_map($mappedRedirects, $redirects),
'openGraph' => [
'defaultImage' => $context->get_loader('post')->load_deferred( absint( $all['og_default_image_id'] ) ),
'defaultImage' => $context
->get_loader('post')
->load_deferred(absint($all['og_default_image_id'])),
'frontPage' => [
'title' => wp_gql_seo_format_string(
$all['og_frontpage_title']
),
'description' => wp_gql_seo_format_string(
$all['og_frontpage_desc']
),
'image' => $context->get_loader('post')->load_deferred( absint( $all['og_frontpage_image_id'] ) ),
'image' => $context
->get_loader('post')
->load_deferred(
absint($all['og_frontpage_image_id'])
),
],
],
];
Expand Down Expand Up @@ -743,15 +759,18 @@ function wp_gql_seo_build_content_type_data($types, $all)
YoastSEO()->meta->for_post($post->ID)
->open_graph_description
),
'opengraphImage' => function() use ( $post, $context ) {

$id = wp_gql_seo_get_og_image(
'opengraphImage' => function () use (
$post,
$context
) {
$id = wp_gql_seo_get_og_image(
YoastSEO()->meta->for_post($post->ID)
->open_graph_images
);

return $context->get_loader('post')->load_deferred( absint( $id ) );

return $context
->get_loader('post')
->load_deferred(absint($id));
},
'twitterCardType' => wp_gql_seo_format_string(
YoastSEO()->meta->for_post($post->ID)
Expand All @@ -765,15 +784,18 @@ function wp_gql_seo_build_content_type_data($types, $all)
YoastSEO()->meta->for_post($post->ID)
->twitter_description
),
'twitterImage' => function() use ( $post, $context ) {

$id = wpcom_vip_attachment_url_to_postid(
YoastSEO()->meta->for_post( $post->ID )
->twitter_image
);

return $context->get_loader( 'post' )->load_deferred( absint( $id ) );
'twitterImage' => function () use (
$post,
$context
) {
$id = wpcom_vip_attachment_url_to_postid(
YoastSEO()->meta->for_post($post->ID)
->twitter_image
);

return $context
->get_loader('post')
->load_deferred(absint($id));
},
'canonical' => wp_gql_seo_format_string(
YoastSEO()->meta->for_post($post->ID)
Expand Down Expand Up @@ -1039,7 +1061,11 @@ function wp_gql_seo_build_content_type_data($types, $all)
YoastSEO()->meta->for_term($term->term_id)
->open_graph_description
),
'opengraphImage' => $context->get_loader('post')->load_deferred( absint( $meta['wpseo_opengraph-image-id'] ) ),
'opengraphImage' => $context
->get_loader('post')
->load_deferred(
absint($meta['wpseo_opengraph-image-id'])
),
'twitterCardType' => wp_gql_seo_format_string(
YoastSEO()->meta->for_term($term->term_id)
->twitter_card
Expand All @@ -1052,7 +1078,11 @@ function wp_gql_seo_build_content_type_data($types, $all)
YoastSEO()->meta->for_term($term->term_id)
->twitter_description
),
'twitterImage' => $context->get_loader('post')->load_deferred( absint( $meta['wpseo_twitter-image-id'] ) ),
'twitterImage' => $context
->get_loader('post')
->load_deferred(
absint($meta['wpseo_twitter-image-id'])
),
'canonical' => wp_gql_seo_format_string(
$meta['canonical']
),
Expand Down

0 comments on commit eaa170e

Please # to comment.