Did you know that you can use ACF in your plugins and themes as well? Both the premium as the free version can be used. It’s quite easy, just create a folder in your plugin (in the example below we’ve used libs/acf
/) and add the ACF files in there. Then we’ll have to add some includes and filters.
Full example
What are the rules for including ACF?
ACF | ACF PRO | |
---|---|---|
Include in a free plugin | ✅ | ❌ |
Include in a free theme | ✅ | ❌ |
Include in a premium plugin | ✅ | ✅ |
Include in a premium theme | ✅ | ✅ |
Include in an “ACF” plugin | ❌ | ❌ |
Share license key information | ❌ | ❌ |
Use as a selling point | ✅ | ❌ |
More information on including can be found in the ACF docs, over here: https://www.advancedcustomfields.com/resources/including-acf-within-a-plugin-or-theme/