2017 © Pedro Peláez
 

wordpress-plugin gravity-forms-acf

Gravity Forms ACF Field

image

statenweb/gravity-forms-acf

Gravity Forms ACF Field

  • Monday, March 5, 2018
  • by mgargano
  • Repository
  • 1 Watchers
  • 0 Stars
  • 181 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 38 % Grown

The README.md

Gravity-Forms-ACF-Field

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

This provides a field that lets you select from a list of active Gravity Forms., (*2)

Compatibility

This add-on will work with:, (*3)

  • version 4
  • Version 5

Installation

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

Plugin 1. Copy the 'Gravity-Forms-ACF-field' folder into your plugins folder 2. Activate the plugin via the Plugins admin page, (*5)

Include 1. Copy the 'Gravity-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), (*6)

  include_once('acf-gravity_forms.php');

Using the field

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

The data returned is either a Form object, an array of Form objects or false if an error occurred., (*8)

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

<?php 
    $form_object = get_field('your_form_field');
    gravity_form_enqueue_scripts($form_object['id'], true);
    gravity_form($form_object['id'], true, true, false, '', true, 1); 
?>

or, (*10)

<?php 
    $form_object = get_field('your_form_field');
    echo do_shortcode('[gravityform id="' . $form_object['id'] . '" title="true" description="true" ajax="true"]');
?>

You can find out more about the gravity_form method to embed a form on a page in their documentation, (*11)

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:, (*12)

<?php
    $form_objects = get_field('your_forms');

    foreach($form_objects as $form){
        echo $form['title'];  
    }
?>

About

2.1.1

  • add the ability to return a form or a form id, forked by @matgargano

1.2

Written by Adam Pope and Liam Gladdy of Storm Consultancy and the amazing contributors on Github, (*13)

Storm Consultancy are a web design and development agency based in Bath, UK., (*14)

If you are looking for a Bath WordPress Developer, then get in touch!, (*15)

Credits

Thanks for Lewis Mcarey for the Users Field ACF add-on on which we based this - https://github.com/lewismcarey/User-Field-ACF-Add-on, (*16)

Thanks to rocketgenius for the Gravity Forms plugin!, (*17)

The Versions

05/03 2018

dev-master

9999999-dev

Gravity Forms ACF Field

  Sources   Download

GPL-3.0+

by Mat Gargano
by Adam Pope

wordpress

05/03 2018

2.1.1

2.1.1.0

Gravity Forms ACF Field

  Sources   Download

GPL-3.0+

by Mat Gargano
by Adam Pope

wordpress

05/03 2018

2.1.0

2.1.0.0

Gravity Forms ACF Field

  Sources   Download

GPL-3.0+

by Mat Gargano
by Adam Pope

wordpress