ACF PRO Installer
, (*1)
A composer plugin that makes installing ACF PRO with composer easier., (*2)
It reads your :key: ACF PRO key from the environment or a .env file., (*3)
Usage
1. Add the package repository to the repositories
field in composer.json
(based on this gist):, (*4)
{
"type": "package",
"package": {
"name": "advanced-custom-fields/advanced-custom-fields-pro",
"version": "*.*.*(.*)",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
"url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download"
},
"require": {
"philippbaschke/acf-pro-installer": "^1.0",
"composer/installers": "^1.0"
}
}
}
Replace "version": "*.*.*(.*)"
with your desired version., (*5)
Replace "type": "wordpress-plugin"
with "type": "library"
if you would like to have ACF PRO installed in the ./vendor
directory instead of ./wp-content/plugins
. This may be desireable if for example, you are including ACF PRO in a WordPress theme., (*6)
2. Make your ACF PRO key available, (*7)
Set the environment variable ACF_PRO_KEY
to your ACF PRO key., (*8)
Alternatively you can add an entry to your .env
file:, (*9)
# .env (same directory as composer.json)
ACF_PRO_KEY=Your-Key-Here
3. Require ACF PRO, (*10)
composer require advanced-custom-fields/advanced-custom-fields-pro:*
You can specify an exact version (that matches your desired version)., (*11)
If you use *
, composer will install the version from the package repository (see 1). This has the benefit that you only need to change the version in the package repository when you want to update., (*12)
Be aware that composer update
will only work if you change the version
in the package repository. Decreasing the version only works if you require an exact version., (*13)