All Projects → hoppinger → Advanced Custom Fields Wpcli

hoppinger / Advanced Custom Fields Wpcli

Licence: mit
Manage Advanced Custom Fields groups in WP-CLI

Labels

Projects that are alternatives of or similar to Advanced Custom Fields Wpcli

Xunit.gherkin.quick
BDD in .NET Core - using Xunit and Gherkin (compatible with both .NET Core and .NET)
Stars: ✭ 123 (-45.33%)
Mutual labels:  gherkin
Radish
Behavior Driven Development tooling for Python. The root from red to green.
Stars: ✭ 153 (-32%)
Mutual labels:  gherkin
Build
BUILD is an open-source, cloud-based and social platform that enables users, even those with no UI development knowledge, to easily create fully interactive prototypes with realistic data, share them with colleagues and consolidate this feedback without writing a line of code.
Stars: ✭ 191 (-15.11%)
Mutual labels:  gherkin
Sdkman For Fish
Adds support for SDKMAN! to fish
Stars: ✭ 139 (-38.22%)
Mutual labels:  gherkin
Bicing Api
Get statistics and locations of bicycle stations through REST API
Stars: ✭ 149 (-33.78%)
Mutual labels:  gherkin
Git Town
Generic, high-level Git workflow support!
Stars: ✭ 1,937 (+760.89%)
Mutual labels:  gherkin
Servicecontainerextension
📻 Allows to declare own services inside Behat container without writing an extension.
Stars: ✭ 114 (-49.33%)
Mutual labels:  gherkin
Vanessa Automation
BDD в 1С
Stars: ✭ 203 (-9.78%)
Mutual labels:  gherkin
Apm
Elastic Application Performance Monitoring - resources and general issue tracking for Elastic APM.
Stars: ✭ 151 (-32.89%)
Mutual labels:  gherkin
Suitesettingsextension
📎 Allows to overwrite suites' default settings.
Stars: ✭ 182 (-19.11%)
Mutual labels:  gherkin
Spectrum
A BDD-style test runner for Java 8. Inspired by Jasmine, RSpec, and Cucumber.
Stars: ✭ 142 (-36.89%)
Mutual labels:  gherkin
Owasp Cloud Security
OWASP Cloud Security - Enabling conversations through threat and control stories
Stars: ✭ 148 (-34.22%)
Mutual labels:  gherkin
Gunit
GUnit - Google.Test/Google.Mock/Cucumber on steroids
Stars: ✭ 156 (-30.67%)
Mutual labels:  gherkin
Specflow
#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
Stars: ✭ 1,827 (+712%)
Mutual labels:  gherkin
Variadicextension
🍺 Extension adding variadic arguments support to Behat steps definitions
Stars: ✭ 194 (-13.78%)
Mutual labels:  gherkin
Rspec Json expectations
Set of matchers and helpers to allow you test your APIs responses like a pro.
Stars: ✭ 115 (-48.89%)
Mutual labels:  gherkin
Ovpnmcgen.rb
An OpenVPN iOS Configuration Profile (.mobileconfig) Utility—Configures OpenVPN for use with VPN-on-Demand that are not exposed through Apple Configurator 2.
Stars: ✭ 154 (-31.56%)
Mutual labels:  gherkin
Green Coffee
Android library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests.
Stars: ✭ 219 (-2.67%)
Mutual labels:  gherkin
White Bread
🍞 Story BDD tool for elixir using gherkin
Stars: ✭ 198 (-12%)
Mutual labels:  gherkin
Web
🐲 Next generation frontend for ownCloud X and Infinite Scale
Stars: ✭ 179 (-20.44%)
Mutual labels:  gherkin

WP-CLI for Advanced Custom Fields

Description

WP-CLI for Advanced Custom Fields helps you manage your field-groups through WP-CLI. The reason we started this project is to make life easier for developers working on Wordpress projects using the Advanced Custom Fields Pro plugin. Fields can now easily be imported, exported and shared over SVN, GIT or comparable systems.

Installation

Requirements

How to install

Install WP-CLI as described on http://wp-cli.org/

Using composer: (doesn't work for now until we have released the plugin on wordpress.org/plugins)

composer require wpackagist-plugin/advanced-custom-fields-wpcli

By GIT clone in plugins directory:

git clone https://github.com/hoppinger/advanced-custom-fields-wpcli.git

WordPress plugin installation: Download zip and put the files in the plugins directory.

  • Activate this plugin in the plugin menu or using:
wp plugin activate advanced-custom-fields-wpcli

Go the wordpress directory in your terminal and run:

wp acf

To see if everything is working correctly.

When the plugin is enabled, any exported field groups found on the filesystem in your registered paths will be added to Wordpress at runtime. If you would like to disable this behaviour you can remove the acf_wpcli_register_groups action:

remove_action('plugins_loaded', 'acf_wpcli_register_groups');

Commands

This project adds the acf command to wp-cli with the following subcommands:

Help

wp acf

Prints the help overview and can be used as a default test to see if the plugin is working.

Export

Export a field-group to a json file in the directory set by a filter.

wp acf export

For testing purposes, etc. you can also define a export directory explicitly without applying the filter by using the --export_path parameter.

wp acf export --export_path=acf-exports/

You want to export all field-groups all at once you can use:

wp acf export --all

Import

wp acf import

Import all or specific fields from a option menu,

Clean

wp acf clean

Delete all Advanced Custom Fields Records from the database. Do this after you have edited fields-groups from the UI and exported the changes. Warning: This can not be undone, please use carefully

Filters

acfwpcli_fieldgroup_paths

The acfwpcli_fieldgroup_paths gives you the ability to add more paths where ACF-CLI should load/export from/to. You should always add at least one path to this filter.

add_filter( 'acfwpcli_fieldgroup_paths', 'add_plugin_path' );

public function add_plugin_path( $paths ) {
  $paths['my_plugin'] = MY_PLUGIN_ROOT . '/lib/field-groups/';
  return $paths;
}

Unit testing

To test changes to the plugin you can use unit testing. Start by making sure all the necessary dependencies are installed, if not run:

composer install

You will need a new Wordpress installation to make sure the tests run independent from your Wordpress installation and database. To create a wordpress installation for testing run the following command:

bash bin/test_wp_install.sh wordpress_test db_username db_password localhost latest

Where 'wordpress_test' is the name for the database used to run the tests. Make sure this database doesn't exist or can be deleted. When the database already exists the script will ask you if the database can be deleted. 'Latest' can be changed if you want to test with a specific version of Wordpress, 3.6.2 for example.

After you installed you can start running tests using the follow command:

vendor/bin/behat

This will run all test. These tests include an import and export of all types of fields, cleaning, multiple fields in one field-group and tests for the menu options. If you want to run one specific test you can do this by running:

vendor/bin/behat features/testname.feature

If you need a different test you can create your own by added it to the features in the features folder.

Upgrade Notice

3.0

  • Make sure you import all your custom fields before updating.
  • Make sure you are you using ACF5, ACF4 is not supported.
  • Update the plugin
  • Add the filter to your project (see Filters)
  • Export you fields
  • Remove unnecessary files like your old import directory, php files and json files.

Changelog

3.0

  • Bugfix: Import no longer created duplicates
  • Add unit testing with behat and PHPUnit

2.0

  • Removed uniqid feature (no longer needed).
  • Bugfix: database fieldgroups are now prefered over exported fieldgroups.
  • Cleaned up legacy xml import/export libraries.
  • Add namespaces.
  • Cleaned up all alternative notation uses.
  • Multisite now correctly makes use of the global --url parameter.
  • Added more comments and versioning.
  • Removed dependency of wp-importer.
  • Added support for composer installs.
  • Dropped XML support, hello Json.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].