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

feat: provide UIs for showing ACF Option Pages in the GraphQL Schema #86

Closed
wants to merge 3 commits into from

Conversation

jasonbahl
Copy link
Contributor

What does this implement/fix? Explain your changes.

ACF Pro v6.2 introduced a UI for creating ACF Option Pages.

This PR brings support for configuring those option pages to show in GraphQL and set the GraphQL Type Name to represent the options page.

Here's how it works 👇🏻

Configure Options Page

When registering an Options Page via the ACF PRO v6.2+ UI, you can configure the Options Page to show in graphql, and set the GraphQL Type Name.

CleanShot 2023-09-06 at 15 22 22

You will see the data in the columns on the list options page as well:

CleanShot 2023-09-06 at 15 27 55

Assign a Field Group

If you assign an ACF Field Group to the Options Page:

CleanShot 2023-09-06 at 15 28 53

You will be able to see that the ACF Field Group is associated with the Options Page Type

CleanShot 2023-09-06 at 15 29 33

Query the Options

Then you can fill in values for the options page:

CleanShot 2023-09-06 at 15 30 35

And query for the options in GraphQL:

CleanShot 2023-09-06 at 15 31 47

Does this close any currently open issues?

closes #83

Any other comments?

Folks using JSON or PHP to register options pages can still do so as they did before, adding fields graphql_type_name and show_in_graphql:

acf_add_options_page(
	[
		'page_title' => 'OptionsPageNode',
		'menu_title' => __( 'Options Page Node' ),
		'menu_slug'  => 'options-page-node',
		'capability' => 'edit_posts',
		show_in_graphql' => true,
		'graphql_type_name'   => 'OptionsPageNode',
	]
);

@jasonbahl
Copy link
Contributor Author

Closing this PR as it has some conflicts. I re-worked the code into this PR #88

@jasonbahl jasonbahl closed this Sep 14, 2023
@jasonbahl jasonbahl deleted the feat/#83-show-in-graphql-options-pages branch January 24, 2024 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support "show_in_graphql" for ACF Options Pages new UI rolled out with ACF v6.2.0
1 participant