Coder Social home page Coder Social logo

medfreeman / gravity-forms-multiple-form-instances Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eggolaz/gravity-forms-multiple-form-instances

0.0 3.0 0.0 65 KB

Allows multiple instances of the same form to be run on a single page when using AJAX.

License: GNU General Public License v2.0

PHP 90.89% Shell 9.11%

gravity-forms-multiple-form-instances's Introduction

Gravity Forms: Multiple Form Instances

Build Status Scrutinizer Code Quality Code Coverage


About

Gravity Forms: Multiple Form Instances is a small plugin for WordPress.

Used in conjunction with the awesome Gravity Forms plugin.

Allows multiple instances of the same form to be displayed on a single page when using AJAX.


Installation & Configuration

This plugin does not need any customization.

Simply install and activate it, and it will do its magic with your Gravity Forms.


How It Works

In order for the magic to work, various occurences of the form ID are replaced with a random ID when rendering the form. This allows for multiple instances of the same form to be submitted without having the issue of submitting form B when submitting form A.

If a form has already been submitted, the submitted random ID will be preserved and used for the next submissions as well, otherwise a new unique ID is generated.


Customization (actions & filters)

The plugin uses the default gform_get_form_filter Gravity Forms filter for performing the replacement.

Additionally, the plugin offers the following actions & filters:

gform_multiple_instances_strings

$strings (array). An array of find => replace pairs. Occurences of "key" will be replaced with the corresponding "value".

$form_id (int). The original form id.

$random_id (int). The new, randomly generated form id.

This filter allows you to modify the default strings that will be replaced. The keys are the original strings, and the corresponding values are the strings that keys will be replaced with.

gravity-forms-multiple-form-instances's People

Contributors

ajoah avatar cfxd avatar eggolaz avatar medfreeman avatar tyxla avatar

Watchers

 avatar  avatar  avatar

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.