This extension for Advanced Custom Fields that makes it possible to manage your field_groups
through the console of wp-cli. The goal of this project is to make life easier for developers who working on Wordpress projects that use Advanced Custom Fields.
wp-cli
did not interface with ACF.- Sharing
field_groups
through XML or PHP code caused problems with differences between development, test, staging and live enviroments when shared with XML. - No direct SVN or GIT support without manually putting the exported PHP or XML into a versioned folder.
- Naming convention for XML files was always the same, resulting in renaming hassle.
- Inconsitensy when selecting multiple
field_groups
by XML. - Generated
field_groups
on runtime through PHP code infunctions.php
diables the editing mode (which is an awesome UI that we require)
- Advanced Custom Fields plugin (activated)
wp-cli
download from GitHub or use the pear package
This project adds the acf
command to wp-cli
with the following subcommands:
-
wp acf status
: provides a dumped array of foundfield_groups
in the current database of your Wordpress project. -
wp acf export
:- writes a
field_group
folder inhttpdocs
(or other root folder of your Wordpress installation). - writes a folder with the
field_group
name for eachfound_field
group. - writes a
data.php
anddata.xml
for eachfield_group
inside their respective folders.
- writes a
-
wp acf import
: imports the XML(s) from the pathfield_groups/{blog_id}/{field_group_name}/data.xml
wp acf import all
imports all the found field-groups from their respective folderswp acf import field-group-name
imports only a single field group
-
wp acf clean
: cleans up the database from all found ACF post types and there coupledpost_meta
values, use this after you've edited thefield_groups
in the UI and used export to generate the newdata.php
files. -
wp acf
: Default test and prints the help overview.
- install
wp-cli
(pear or download) - put the
advanced-custom-fields-wpcli
folder inwp-content/plugins
- activate
advanced-custom-fields-wpcli
plugin through "wp plugin activate advanced-custom-fields-wpcli" - go the terminal and go to your wordpress folder
- type
wp
(and see the wp-cli commands if installed correctly) - type
wp acf
to test theacf-wpcli
extension - start using the commands as explained in "Commands"
- make
acf-wpcli
extension update-proof - try to make
acf-wpcli
a real part of ACF through the plugin creator Elliot Condon Advanced Custom Fields - clean up code and refractor
- add more comments and versioning
- relocate the
field_groups
folder to something that makes a little more sense - try to fix the
wp-importer
problem that caused the use of copied code fromwp-importer
plugin
- made multisite compatible for both console and cms part
- Moved the extension out of advanced-custom-fields to it's own plugin folder to resolve update issues bound to happen
- Check to make sure the plugin admin code will only be ran when the ACF plugin is already loaded
- Initial project start
- Added status, export, import and clean commands
- Used wordpress-importer classes directly in the project
- moved the data.php or use database check to advanced-custom-fields/wp-cli/run.php
- wrote first version of readme.txt