Git Product home page Git Product logo

gravity-forms-acf-field's Introduction

Gravity-Forms-ACF-Field

This is an Advanced Custom Field custom field to select one or many Gravity Forms.

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

Compatibility

This add-on will work with:

  • version 4
  • Version 5

Installation

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

Plugin

  1. Copy the 'Gravity-Forms-ACF-field' folder into your plugins folder
  2. Activate the plugin via the Plugins admin page

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)
  include_once('acf-gravity_forms.php');

Using the field

The field lets you pick one or many fields.

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

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

<?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

<?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

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:

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

About

Version: 1.2

Written by Adam Pope and Liam Gladdy of Storm Consultancy and the amazing contributors on Github

Storm Consultancy are a web design and development agency based in Bath, UK.

If you are looking for a Bath WordPress Developer, then get in touch!

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

Thanks to rocketgenius for the Gravity Forms plugin!

gravity-forms-acf-field's People

Contributors

adampope avatar ajmorris avatar dabernathy89 avatar jimwebb avatar lgladdy avatar marcoevich avatar styledev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gravity-forms-acf-field's Issues

Notice: Trying to get property of non-object

Hi Elliot,

I'm experiencing and issue with the plugin. It generates this error:

Notice: Trying to get property of non-object in /home/comonede/MesSites/travelersparking.com/wp-content/themes/travellers/inc/partials/gravity_form_code.php on line 4

Notice: Trying to get property of non-object in /home/comonede/MesSites/travelersparking.com/wp-content/themes/travellers/inc/partials/gravity_form_code.php on line 5

Oops! We could not locate your form.

"gravity_form_code.php" contains the code below:

<div>
    <?php 
        $form = get_sub_field('custom_form_gravity');
        gravity_form_enqueue_scripts($form->id, true);
        gravity_form($form->id, true, true, true, '', true, 1); 
    ?>
</div>

When i try to var_dump($form). it only returns:

string(3331) ""

Im using the acf gravity form plugin inside "acf flexible content". Acf version is 4.4.0 and Gravity is 1.9.

Thanks,
Darwin

Not storing selection in database...

When I select a Gravity Forms form, it apparently isn't storing in the database because the menu item returns to "-Select-" in the editor and no values are returned on the front end.

How to specify a single form that can be used inside an ACF repeater field

When I add one of these ACF-GF fields to an ACF form, the gravity form is the ONLY thing that shows up (all the other standard ACF fields don't).

And when I put the ACF-GF field in an ACF Repeater field, it renders the GF form (as stated above) but clicking the "Add Row" button just shows a selection box of all the existing GF forms.

So how do I say I want GF Form ID 3 to be completed per each Repeater Field row?

tyvm!

Salesforce web2lead plugin endpoint change

Hi,

I'm not certain how gravity forms works with the Salesforce endpoint. Recently, we have received guidance that the Salesforce endpoint for web2lead and web2cases has changed.

We need to update the endpoint. How would we do that?

Thanks,

Ron

This plugin no longer works

If you assign a field group to a custom post type, no fields are rendered at all. The save button is missing.

If you set allow null to true, then you can edit your post, but you get this PHP error:
Fatal error: Class 'RGFormsModel' not found in /home/wp-content/plugins/Gravity-Forms-ACF-Field-master/gravity_forms-v4.php on line 119

Also if you then delete the gravity forms field from the field group, there's a PHP error:

Notice: Undefined variable: field in /home/wp-content/plugins/advanced-custom-fields/core/fields/_functions.php on line 525

Warning: Cannot modify header information - headers already sent by (output started at /home/wp-content/plugins/advanced-custom-fields/core/fields/_functions.php:525) in /home/wp-includes/pluggable.php on line 1178

DatePicker not working when AJAX is enabled

Hello,

I just found that DatePicker not working when AJAX is enabled if Im using the php shortcode.

The code I'm using is

name == '2' ) { if ( get_field('form') ){ $form = get_field('form'); gravity_form_enqueue_scripts($form->id, true); gravity_form($form->id, false, false, false, '', true); } }} ?>

however the datepicker is not showing the datepicker selection box.

Once I changed the code to (enabling ajax)

gravity_form($form->id, false, false, false, '', false); 

the date picker selection box is showing normally.

This error is occuring only when I'm using ACF gravity forms Field, If I embed the form using shortcode directly the datepicker is working irrespective of weather ajax is enabled or not.

Im using Wordpress 3.6 and ACF 4.2.1 and ACF: GFF 1.0.0 and GF 1.7.7

Any help is appriciated.

MU-Plugins

Theme Independent Installation of your ACF add-on

in file wp-acf-addons.php

function acf_add_extended_plugins() {
if(function_exists('register_field')) {
register_field('Gravity_Forms_field', dirname(File) . '/custom-fields/gravity_forms.php');
}
}

add_action('init', 'acf_add_extended_plugins');

and then just throw in the custom-fields inside mu-plugins
Screen Shot 2013-02-10 at 2 20 03 PM

Warning

I got this messages:

  • "Warning: include_once(acf-gravity_forms.php): failed to open stream: No such file or directory in /.../functions.php on line 1391"
  • Warning: include_once(): Failed opening '/acf-gravity_forms.php' for inclusion (include_path='.:/opt/php54/lib/php') in /.../functions.php on line 1391

Any ideas how to fix this?

Not allowing multiple selections

When I create a new custom field and set the type to "Gravity Forms" and set "Allow Multiple?" to "Yes" i still am only seeing a drop-down that allows for a single selection. All of the other parameters — Required, Allow null, Conditional ,etc. — work as normal. There are no obvious errors rendered on the page.

The field is being used in a field group set to appear on an Options page. I've tried moving it to other Options pages, in combination with other fields and as a standalone field. I've also tried it as part of field group that only applies to post types.

I'm using version 1.0.0 of the plugin and version 5.0.8 of ACF Pro.

Is anyone else experiencing this?

No blank option available

I'm using v1.0.0 and ACF Pro 5.1.7 on a customer website, but since an update to ACF Pro I seem not to have the option of a blank selection anymore.

Would be great if this could get fixed.. Thx in advance!

Cannot call form within a Flex field

The parent div for the form loads, so I know I'm calling the flex field correctly but the following code does not call my GF:

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

I have also tried changing the get_sub_field to get_field and also tried adding 'option' after select_form (since the data is on the options page). In addition I have tried:

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

Nothing is working. Please help!

v3 + v4 WP plugin

Hi @stormuk

I'm working on a new project and have used your gravity form field which is working great!

I noticed that you have 2 separate versions and wanted to let you know of the ACF field type template which allows for easy development for v3 + v4 compatible WP plugins!

I've created a plugin version and attached it here (http://cl.ly/180C3R3x0m1R). Feel free to look over it, add in the missing info ( mustache placeholders ) and update your repo if you want.

Cheers
Elliot

WP.org

Good morning!
Is your plugin released on WP.org?

May I release it there?

Version Info

your readme file says v 1.2 but your acf-gravity_forms file still says 1.1.0

Which is it?

Composer packagist

Do you have any plans to create a composer package of this repo? Would be great :) Let me know if I can help!

Freezes Edit Page

I have a lot going on using ACF.. but basically I have a repeater that builds page content of all types. It may be an issue with ACF Repeater + ACF Gravity Forms, but when ACF Gravity Forms plugin is Active I can no longer add repeater sections or edit existing.

before
after

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.