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

Issue: Theme options in WPGraphQL with Carbon Fields #1

Closed
tysian opened this issue Feb 3, 2021 · 4 comments
Closed

Issue: Theme options in WPGraphQL with Carbon Fields #1

tysian opened this issue Feb 3, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@tysian
Copy link

tysian commented Feb 3, 2021

Hello!
I've decided to use your plugin along with Carbon fields (v. 3.2) and WPGraphQL.
Unfortunately the theme_options field doesn't show up in the GraphQL IDE in my wordpress (v. 5.6).
My theme options container looks like this:

WpGraphQLCrbContainer::register(
    Container::make( 'theme_options', __( 'Theme Options' ) )
        ->add_tab( 'Footer', [
            Field::make( 'text', 'footer_text', 'Footer text' ),
        ] )
);

Adding ->set_visible_in_rest_api(true) didn't change anything.
Is this something expected, maybe you can help me with this problem?

Kind regards,
Jakub.

@matepaiva
Copy link
Owner

Hi @tysian!

Glad to hear that you are using it. I made this plugin one year ago and then I didn't touch it anymore. Basically, I was the only person using it ─ as far as I know ─ and I didn't need to expose the theme options through GraphQL.

So, the theme_options were not contemplated in that first version. I would add it later... and "later" never came, heh.

I will read the code again to try to understand what I would have to do to add support to theme options. I guess it's going to be easy.

Also, if you want to try adding the feature and sending a PR, you are most welcome.

@matepaiva
Copy link
Owner

Hello, @tysian. I implemented a solution that now exposes theme_options to GraphQL. Please update your dependencies. As I am not working with versioning yet, you might have some trouble updating the code. I will address it tomorrow.

Let me know if that is enough for your usage.

Also, are you installing the plugin via packagist? The readme had wrong information, but it is now up to date.

@tysian
Copy link
Author

tysian commented Feb 4, 2021

Hey @matepaiva!

Thank you very much for fast response! Theme Options were pretty important for me, because they were replacement for ACF Pro Options...
I've tried to fork your project and fix it by myself, but I got lost somewhere on Container.php haha :)
But after your update, I removed previous version from vendor directory and run composer require matepaiva/wp-graphql-crb:dev-master and everything works perfect! You rescued me from buying ACF Pro or using different CMS 👍

Thanks!

@matepaiva
Copy link
Owner

Great! So can I close this issue?

@matepaiva matepaiva self-assigned this Feb 4, 2021
@matepaiva matepaiva added the enhancement New feature or request label Feb 4, 2021
@tysian tysian closed this as completed Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants