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

Call to undefined function add_action when using a dependency based WordPress structure (e.g. Bedrock) #1

Closed
tombonez opened this issue Jun 16, 2020 · 4 comments
Assignees

Comments

@tombonez
Copy link

Hi @jofrysutanto,

First of all, thanks for creating this awesome project, I can't wait to (hopefully) switch from ACF Builder as this looks like a much easier and cleaner way of using ACF with version control support 😃

Unfortunately it appears that ACF Windsors can't currently work with dependency based WordPress structures such as Roots Bedrock, as add_action is called before the function exists.

Other projects such as Timber get around this by having the user initialise it via functions.php.

Hopefully this is something you'd be willing to change as I'd love to use ACF Windsor moving forward.

Any questions or what not just let me know.

Cheers,
Tom 🙂

@jofrysutanto
Copy link
Owner

This is definitely something I am going to address, thanks for bringing it up!

At the moment the library is set to auto-initialize as a means of convenience. I am thinking of giving the flexibility for developers to defer this initialization, and leave it to developers to decide when to initialize the library. Which I think will solve the issue if you are using Bedrock.

I will play around with it using Bedrock, stay tuned.

Jofry.

@jofrysutanto jofrysutanto self-assigned this Jun 16, 2020
@tombonez
Copy link
Author

Awesome! Thanks a ton Jofry 😃

jofrysutanto added a commit that referenced this issue Jun 16, 2020
@jofrysutanto
Copy link
Owner

Resolved by #2 — feel free to take it for a spin @tombonez

@tombonez
Copy link
Author

The latest release is working a treat, thanks again @jofrysutanto 😃

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

No branches or pull requests

2 participants