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

Plugin checks acf_register_block before ACF is initialized #19

Open
peXed opened this issue Jul 23, 2019 · 4 comments
Open

Plugin checks acf_register_block before ACF is initialized #19

peXed opened this issue Jul 23, 2019 · 4 comments

Comments

@peXed
Copy link

peXed commented Jul 23, 2019

Hello!

I just tried your plugin but ran into an issue. The blocks didn't get loaded, because you very first check failed.

if (! function_exists('acf_register_block')) { return; }

I guess the problem is the way i implemented ACF (I include it in the setup.php of my sage theme).

An easy fix would be, to move the check into the 'acf/init' action. Or would that break something?
Is there a recommended way to include ACF Pro into Sage, so your plugin works out of the box?

Thanks!

@luukskeur
Copy link
Contributor

This is probably not due to a wrong implementation of ACF.
I've had a similar problem and it is because the function acf_register_block is only available in the PRO version. Added since version 5.8.0 so make sure to have the ACF Pro plugin ^5.8.0.

If you still find issues please provide WP + plugins versions.

@Gandhi11
Copy link

Gandhi11 commented Apr 23, 2021

Hi @luukskeur, I have the same problem. It look like the sage-acf-gutenberg-blocks.php file loaded before the acf_register_block_type function is created.

I am using [email protected] using bedrock, ACF [email protected] and mwdelaney/[email protected]

@Gandhi11
Copy link

I found the problem. I required mwdelaney/sage-acf-gutenberg-blocks on the root of bedrock instead of the root of the sage theme. 😥

@ninjacreative
Copy link

I seem to be having the same issue with Sage 9, despite using ACF Pro. Any recommendations on how to work around this when not using bedrock?

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

4 participants