Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Sync changes in master with develop #391

Merged
merged 7 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# WPGraphQL for Advanced Custom Fields

----

🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨

This plugin has gone through a complete re-architecture and this repository will soon be archived.

We recommend you upgrade to the new WPGraphQL for ACF v2.0+ at your earliest convenience.

The new version contains breaking changes, so update with caution. Below are some resources to help:

- UPGRADE GUIDE: https://acf.wpgraphql.com/upgrade-guide
- NEW PLUGIN REPO: https://github.com/wp-graphql/wpgraphql-acf
- NEW PLUGIN ON WORDPRESS.ORG: https://wordpress.org/plugins/wpgraphql-acf
- NEW PLUGIN ON COMPOSER: https://packagist.org/packages/wp-graphql/wpgraphql-acf
- NEW PLUGIN ON WPPACKAGIST: https://wpackagist.org/search?q=wpgraphql-acf&type=any&search=

🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
----

WPGraphQL for Advanced Custom Fields automatically exposes your ACF fields to the WPGraphQL Schema.

- [Install and Activate](#install-and-activate)
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://wpgraphql.com/acf
Tags: WPGraphQL, GraphQL, API, Advanced Custom Fields, ACF
Requires at least: 5.0
Tested up to: 5.1.1
Stable tag: 0.6.1
Stable tag: 0.6.2
License: GPL-3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand All @@ -21,6 +21,11 @@ SEE: https://github.com/wp-graphql/wp-graphql-acf/releases

== Upgrade Notice ==

= 0.6.2 =

NOTE: This is the final release of this plugin. Please migrate to the [new WPGraphQL for ACF](https://github.com/wp-graphql/wpgraphql-acf) at your earliest convenience.


= 0.1.1 =
ACF Field groups were not properly being added to the GraphQL Schema for Custom Post Types. This
addresses that issue, so now Field groups that are set to "show_in_graphql" and are assigned to a
Expand Down
6 changes: 3 additions & 3 deletions src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ protected function register_graphql_field( string $type_name, string $field_name
'resolve' => function( $root, $args, $context, $info ) use ( $acf_field ) {
$value = $this->get_acf_field_value( $root, $acf_field );

return DataSource::resolve_post_object( (int) $value, $context );
return $context->get_loader( 'post' )->load_deferred( (int) $value );
},
];
break;
Expand Down Expand Up @@ -903,11 +903,11 @@ protected function register_graphql_field( string $type_name, string $field_name
*/
if ( ! empty( $value ) && is_array( $value ) ) {
foreach ( $value as $term ) {
$terms[] = DataSource::resolve_term_object( (int) $term, $context );
$terms[] = $context->get_loader( 'term' )->load_deferred( (int) $term );
}
return $terms;
} else {
return DataSource::resolve_term_object( (int) $value, $context );
return $context->get_loader( 'term' )->load_deferred( (int) $value );
}
},
];
Expand Down
4 changes: 2 additions & 2 deletions wp-graphql-acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://www.wpgraphql.com
* Text Domain: wp-graphql-acf
* Domain Path: /languages
* Version: 0.6.1
* Version: 0.6.2
* Requires PHP: 7.0
* GitHub Plugin URI: https://github.com/wp-graphql/wp-graphql-acf
*
Expand All @@ -26,7 +26,7 @@
* Define constants
*/
const WPGRAPHQL_REQUIRED_MIN_VERSION = '0.4.0';
const WPGRAPHQL_ACF_VERSION = '0.6.1';
const WPGRAPHQL_ACF_VERSION = '0.6.2';

/**
* Initialize the plugin
Expand Down
Loading