2017 © Pedro Peláez
 

wordpress-plugin acf-ninja-forms

Adds an Advanced Custom Fields field to select one or many Ninja Forms.

image

bostondv/acf-ninja-forms

Adds an Advanced Custom Fields field to select one or many Ninja Forms.

  • Saturday, April 14, 2018
  • by bostondv
  • Repository
  • 2 Watchers
  • 9 Stars
  • 1,269 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

ACF Ninja Forms Field

This is an Advanced Custom Field custom field to select one or many Ninja Forms., (*1)

Compatibility

  • ACF version 4 and up
  • Ninja Forms version 2.9.X and up

Installation

This add-on can be treated as both a WP plugin or a theme include., (*2)

Plugin 1. Copy the 'acf-ninja-forms' folder into your plugins folder 2. Activate the Advanced Custom Fields: Ninja Forms Field plugin through the 'Plugins' menu in WordPress, (*3)

Include 1. Copy the 'acf-ninja-forms' 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-ninja-forms.php file), (*4)

function my_register_fields() {
    include_once( 'acf-ninja-forms.php' );
}
add_action( 'acf/register_fields', 'my_register_fields' );

Using the field

The field lets you pick one or many fields., (*5)

The data returned is either a Form object or an array of Form objects., (*6)

If you have selected a single form and you want to display the form on the page, you can use:, (*7)

Ninja Forms 3.X.X, (*8)

<?php
$form = get_field( 'your_form_field' );
if ( class_exists( 'Ninja_Forms' ) ) {
    Ninja_Forms()->display( $form[ 'id' ] );
}
?>

Ninja Forms 2.9.X, (*9)

<?php
    $form = get_field( 'your_form_field' );
    if ( function_exists( 'ninja_forms_display_form' ) ) {
        ninja_forms_display_form( $form[ 'id' ] );
    }
?>

You can find out more about the Ninja Forms methods to embed a form on a page in their documentation, (*10)

If you are using the field to select multiple forms, you will have to iterate over the array. You can then use the form object as you like:, (*11)

<?php
    $forms = get_field('your_forms');
    foreach( $forms as $form ){
        echo $form[ 'id' ];
    }
?>

About

Made with <3 by Boston Dell-Vandenberg., (*12)

Credits

Thanks to Adam Pope for the ACF Gravity Forms and Lewis Mcarey for the Users Field ACF add-ons on which we based this on., (*13)

The Versions

14/04 2018

dev-master

9999999-dev https://github.com/bostondv/acf-ninja-forms

Adds an Advanced Custom Fields field to select one or many Ninja Forms.

  Sources   Download

MIT

The Requires

 

wordpress css forms acf advanced custom fields ninja forms

14/04 2018

1.0.4

1.0.4.0 https://github.com/bostondv/acf-ninja-forms

Adds an Advanced Custom Fields field to select one or many Ninja Forms.

  Sources   Download

MIT

The Requires

 

wordpress css forms acf advanced custom fields ninja forms

01/10 2017

1.0.3

1.0.3.0 https://github.com/bostondv/acf-ninja-forms

Adds an Advanced Custom Fields field to select one or many Ninja Forms.

  Sources   Download

MIT

The Requires

 

wordpress css forms acf advanced custom fields ninja forms

02/07 2015

1.0.2

1.0.2.0 https://github.com/bostondv/acf-ninja-forms

Adds an Advanced Custom Fields field to select one or many Ninja Forms.

  Sources   Download

MIT

The Requires

 

wordpress css forms acf advanced custom fields ninja forms

29/05 2015

1.0.1

1.0.1.0 https://github.com/bostondv/acf-ninja-forms

Adds an Advanced Custom Fields field to select one or many Ninja Forms.

  Sources   Download

MIT

The Requires

 

wordpress css forms acf advanced custom fields ninja forms

29/05 2015

1.0.0

1.0.0.0 https://github.com/bostondv/acf-ninja-forms

Adds an Advanced Custom Fields field to select one or many Ninja Forms.

  Sources   Download

GPLv3

The Requires

 

wordpress css forms acf advanced custom fields ninja forms