Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register field group to post even when multiple location rules are set #99

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

t0lya
Copy link

@t0lya t0lya commented Dec 12, 2019

For example, let's say you have added 2 rules on the field group: post_category = SOME_CATEGORY and post_type = SOME_TYPE. You want editors to see specific field groups based on post_category. Currently, the field group won't show up in WPGraphQL. This PR will register any field group, as long as a post_type rule is specified at least once.

@jasonbahl
Copy link
Contributor

@let00 this is an interesting approach. 🤔 It does seem like this lines up with most people's expectations.

@jasonbahl jasonbahl self-assigned this Dec 13, 2019
@jasonbahl
Copy link
Contributor

@let00 this is an interesting approach. 🤔 It does seem like this lines up with most people's expectations.

@t0lya
Copy link
Author

t0lya commented Dec 13, 2019

@jasonbahl My approach is similar to https://github.com/wp-graphql/wp-graphql-acf/blob/develop/src/class-config.php#L1346-L1446.

So one hacky way to use multiple post location rules is to add a dummy individual post rule, like this:
Screenshot (33)

But if an author removes the individual post, you don't want to go and update the rule every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants