Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ChuckMac/ninja-forms-acf-field

Advanced Custom Fields: Ninja Forms Field
https://github.com/ChuckMac/ninja-forms-acf-field

Last synced: 27 days ago
JSON representation

Advanced Custom Fields: Ninja Forms Field

Awesome Lists containing this project

README

        

Ninja-Forms-ACF-Field
=======================

This is an Advanced Custom Field custom field to select one or many [Ninja Forms](https://ninjaforms.com/).

This provides a field that lets you select from a list of active Ninja Forms.

Compatibility
============

This add-on will work with:

* ACF version 5

Installation
============

This add-on can be treated as both a WP plugin and a theme include.

*Plugin*
1. Copy the 'ninja-forms-acf-field' folder into your plugins folder
2. Activate the plugin via the Plugins admin page

*Include*
1. Copy the 'ninja-forms-acf-field' folder into your theme folder (can use sub folders). You can place the folder anywhere inside the 'wp-content' directory
2. Edit your functions.php file and add the code below (Make sure the path is correct to include the acf-gravity_forms.php file)

```
include_once('acf-ninja_forms.php');
```

Using the field
===============

The field lets you pick one or many fields.

The data returned is either a Form settings array or, for multiple values, an object of [Form settings arrays](http://www.gravityhelp.com/documentation/page/Form_Object).

The following example will work with single or multiple form entries.

```
display( $ninja_form['id'] );
} elseif( class_exists( 'Ninja_Forms' ) && is_object( $ninja_form ) ){ // Ninja forms 3.x
foreach ($ninja_form as $form) {
Ninja_Forms()->display( $form['id'] );
}
}
?>
```

You can find out more about the ninja forms functions to embed a form or form data on a page in their [documentation](http://docs.ninjaforms.com/category/29-global-variables)

Versioning
=====

Since this is a drop-in plugin, we will make sure that versioning happens according to the main plugin.

Credits
=======

Thanks to Adam Pope of [Storm Consultancy](http://www.stormconsultancy.co.uk) for the [Gravity Forms ACF Field](https://github.com/stormuk/Gravity-Forms-ACF-Field) plugin which this is based on.

And in turn, Lewis Mcarey for the [Users Field ACF add-on](https://github.com/lewismcarey/User-Field-ACF-Add-on) on which the Gravity Forms ACF field was based.