This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
Dynamically check field groups against visibility conditions #65
Labels
Location Rules
Issues related to ACF Location Rules
Milestone
@jasonbahl There may be a way around this, but I noticed that the registering if field groups within WPGraphQL is a bit limited. For instance:
https://github.com/wp-graphql/wp-graphql-acf/blob/release/v0.2.1/src/class-config.php#L142-L146
This section checks if the
post_type
is equal to a page, but I have two conditions on this particular Field Group:page
This seems more like a limitation of ACF, but when running
acf_get_field_groups( [ 'post_type' => 'page' ] )
, field groups with ONLY that condition show. If there are more conditions (such as a page template type), the function returns empty.I need ACF fields added to the GraphQL Schema of a page that is also a specific template. For now, it seems like I may have to add these myself? Please let me know if I'm doing something wrong or if this is a known limitation.
Thanks!
The text was updated successfully, but these errors were encountered: