|
| 1 | +# WP ACF Select Gravity Forms |
| 2 | + |
| 3 | +> ACT Type to select a new Gravity Form |
| 4 | +
|
| 5 | +## Description |
| 6 | + |
| 7 | +This is a type for the [ACF plugin](https://www.advancedcustomfields.com/) that creates a new select type |
| 8 | +of field to allow easy selection of [Gravity Forms](http://www.gravityforms.com/). |
| 9 | + |
| 10 | +It creates a dropdown with a list of all active forms in the site by title and returns |
| 11 | +the ID of the form to be used as required. if the value none is selected it will return |
| 12 | +`0` as the default value for no form selected. |
| 13 | + |
| 14 | +## Requirements |
| 15 | + |
| 16 | +- PHP 5.4+ |
| 17 | +- Composer |
| 18 | +- ACF 5+ |
| 19 | +- Gravity Forms plugin |
| 20 | + |
| 21 | +## Installation. |
| 22 | + |
| 23 | +This plugin works only on ACF 5 and above so please make sure you have the correct version |
| 24 | +mentioned on the (requirements)[#requirements] section. In order to install this new |
| 25 | +type you need to add a `composer.json` file at the root of your WordPress project as follows. |
| 26 | + |
| 27 | +```json |
| 28 | +{ |
| 29 | + "name": "project-name", |
| 30 | + "require": { |
| 31 | + "php": ">=5.4", |
| 32 | + "moxie-lean/acf-gravity-forms-select": "^0.1.0" |
| 33 | + } |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +Or directly from your terminal: |
| 38 | + |
| 39 | +```bash |
| 40 | +composer require moxie-lean/acf-gravity-forms-select |
| 41 | +``` |
| 42 | + |
| 43 | +And then run `composer update` and activate the new ACF Type as a regular plugin. |
| 44 | + |
| 45 | +**Note:** Make sure you have executed `composer install && composer update` cmd on the |
| 46 | +directory `.wp-content/plugins/acf-gravity-forms-select`. |
| 47 | + |
| 48 | +However, this can be automated by adding the following to your `composer.json` |
| 49 | +located at the root of your project. |
| 50 | + |
| 51 | +```json |
| 52 | +{ |
| 53 | + "name": "project-name", |
| 54 | + "require": { |
| 55 | + "php": ">=5.4", |
| 56 | + "moxie-lean/acf-gravity-forms-select": "^0.1.0" |
| 57 | + }, |
| 58 | + "scripts": { |
| 59 | + "install-gravity-forms-select": "cd ./wp-content/plugins/acf-gravity-forms-select && composer install && composer update", |
| 60 | + "post-install-cmd": "@install-gravity-forms-select", |
| 61 | + "post-update-cmd": "@install-gravity-forms-select" |
| 62 | + } |
| 63 | +} |
| 64 | +``` |
| 65 | + |
| 66 | +And this will create the required files on the `ACF Type`. |
0 commit comments