Support

Account

Home Forums ACF PRO Use ACF inside a Plugin and force this Version

Solved

Use ACF inside a Plugin and force this Version

  • Hello,
    I’m using ACF PRO inside a Plugin. This means, I include it like it’s described in the documentation. It works fine.

    My Problem: In one WP-Installation the free Version of ACF is installed as a Plugin. And this gets loaded. The result is, that I can’t use the acf/init-Action to register Optionpages via acf_add_options_page since this Action is part of the PRO-Version.

    Is there a way to force the use of the Pro-Version located inside my Plugin?

  • This has to do with the order that the plugins are loaded by WP. The first one loaded wins. There are other significant differences in these plugins work, they really are not compatible. I’ve run into issue with themes that load ACF4 and require it to be installed and active. What you really need to do is install ACF Pro and go through the update procedure and then deactivate ACF4 and never use it again.

  • Yes, that’s the cleanest method. And I’ll do this on this praticular installation.

    But sometimes I have no control over the used plugins (e.g. if I do work for an Agency). And in these cases it is required by ACF, that I use it as an include in my plugin.

  • I don’t think there is a good answer to this. You could detect that a different version is activated and then deactivate it, but this would not work of the other version was also installed in a plugin, or in the theme. Even if this would work there is still the problem of the two versions not being completely compatible. This is one of the main reasons that I do not build ACF into the plugins that I create that require ACF and instead say that ACF Pro is a requirement of using my plugin. Some of my plugins cannot even be activated if ACF Pro is not active. There have been cases where I had to completely rework a plugin for sites that use themes that include ACF4 because there wasn’t any way to deactivate the requirement for ACF4. There have also been cases where I have refused a project because it was impossible to make the site compatible with my needs.

    Sorry for the long non-answer answer.

  • Thank you for your answer. I’ve reviewed the Code of ACF and I’m with you.

    Usualy use ACF Pro in Themes for completly new projects. In these cases, I handle it the same way like you: ACF Pro is a requirement for the theme to run. But in these cases I’m in complete control of the installed plugins.

    I’m going an other route with the current Plugin and use the build in functions of WP or a framework for the options.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Use ACF inside a Plugin and force this Version’ is closed to new replies.