• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    PHP
  • Created almost 11 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Gravity Forms add-on to embed a form in an auto-resizing iframe on external sites.

Gravity Forms Iframe Add-on

Embed a Gravity Form in an iframe on any site.

Contributors: Brady Vercher
License: GPL-2.0+

The typical process to embed a Gravity Form on a site where the plugin isn't installed requires:

  1. Developing a custom page template with necessary code to output form scripts and styles.
  2. Creating a new page in WordPress.
  3. Inserting the form shortcode in the new page.
  4. Manually writing an iframe tag with the page permalink and giving it a static height.

With the Gravity Forms Iframe add-on, just enable a setting to allow the form to be embedded and copy the code snippet. That's it. As a bonus, the iframe automatically resizes whenever the form height changes -- for instance, when fields are shown or hidden due to conditional logic.

Features

  • Selectively enable embedding for individual forms.
  • Auto-resizing iframes.
  • Override embed templates in a theme or child theme.
  • Override settings via the embed src query string.
  • Extends the Gravity Forms add-on API to seamlessly integrate with the WordPress and Gravity Forms interface.
  • Protocol-relative URLs for embedding on secure sites (both sites need SSL).

Settings

The form title and description can be hidden independent of regular form display by toggling a checkbox after enabling the embedding setting.

Form Iframe Settings Screenshot The form's iframe settings panel.

Overrides for Individual Iframes

If the title and description settings need to be changed per embed, they can be modified in the iframe src query string.

  • dt: Set to 1 to display the form title; 0 to hide.
  • dd: Set to 1 to display the form description; 0 to hide.

Example: gfembed/?f=1&dt=0&dd=0

Auto-resizing Script

If the auto-resizing functionality isn't needed for a particular form, adjust the iframe's height attribute to accomodate the form and don't include the <script> tag when copying the embed code. Leaving off the script tag will save an HTTP request.

Confirmation Screen

If you redirect users to another page upon submission and would like the iframe to automatically resize, include the following in the confirmation page: add_filter( 'gfiframe_print_resize_ping_script', '__return_true' );

Template Hierarchy

Templates can be added in a theme or child theme to override the plugin's template. Use the following template names:

  • gravity-forms-iframe-{$form_id}.php
  • gravity-forms-iframe.php

Installation

Upload

  1. Download the latest release from GitHub.
  2. Go to the Plugins → Add New screen in your WordPress admin panel and click the Upload tab at the top.
  3. Upload the zipped archive.
  4. Click the Activate Plugin link after installation completes.

Manual

  1. Download the latest release from GitHub.
  2. Unzip the archive.
  3. Copy the folder to /wp-content/plugins/.
  4. Go to the Plugins screen in your WordPress admin panel and click the Activate link under Gravity Forms Iframe.

Read the Codex for more information about installing plugins manually.

Git

Clone this repository in /wp-content/plugins/:

git clone [email protected]:bradyvercher/gravity-forms-iframe.git

Then go to the Plugins screen in your WordPress admin panel and click the Activate link under Gravity Forms Iframe.

Changelog

2.0.2

  • Updated embed code field in the admin panel to work with Gravity Forms 2.5+.
  • Passed an object instead of a string in the auto-resize message.
  • Changed the method for hiding the admin bar to improve reliability.
  • Added GitHub Update compatibility.

2.0.1

  • Made GravityFormsIframe_Addon::form_settings_fields() compatible with the parent class.

2.0.0

  • Moved to the Cedaro GitHub account.
  • Refactored the plugin structure.
  • Introduced a 'gfiframe_head' action in the template header.

1.0.3

  • Defined 'gravityforms_iframe' capability in the Add-on class to integrate with the Members plugin.

1.0.2

  • Fixed a long-standing bug that may have prevented scripts from loading in the iframe template.
  • Fixed deprecated notices in Gravity Forms 1.9+.

1.0.1

  • Deprecated the .php extension in the embed rewrite rule to prevent conflicts with WordPress Multisite.
  • Disabled the WordPress toolbar in iframes when forms are embedded on the host domain.
  • Added a POT file for translators.

1.0.0

  • Initial release.

More Repositories

1

satispress

Expose installed WordPress plugins and themes as Composer packages.
PHP
503
star
2

grunt-wp-i18n

Internationalize WordPress themes and plugins with Grunt.
JavaScript
160
star
3

woocommerce-coupon-links

A WordPress plugin to automatically apply WooCommerce coupon codes to the cart via a URL.
PHP
133
star
4

wprestcop

Manage access to the WP REST API with rate limits and IP-based rules.
PHP
70
star
5

shiny-code

A Gutenberg block for editing and displaying code with syntax highlighting.
JavaScript
51
star
6

node-wp-i18n

Internationalize WordPress themes and plugins.
PHP
45
star
7

cpt-archives

A WordPress plugin to manage post type archive titles, descriptions, and permalink slugs from the dashboard.
PHP
44
star
8

infinite-wp-list-tables

A WordPress plugin to add infinite scroll support for WP List Tables in the admin panel.
PHP
40
star
9

wp-plugin

A library to help structure and bootstrap WordPress plugins.
PHP
40
star
10

grunt-wp-css

Format style sheets according to the WordPress CSS coding standards.
JavaScript
35
star
11

simple-image-widget

A simple WordPress image widget.
PHP
32
star
12

plugin-toggle

A WordPress plugin to quickly toggle plugin activation status from the toolbar.
PHP
30
star
13

dequeue-jquery-migrate

A WordPress plugin to remove the jquery-migrate.js script dependency.
PHP
27
star
14

structure

Examples demonstrating methods for structuring WordPress plugins.
25
star
15

wp-address-block

A Gutenberg block for displaying an address with Schema.org markup.
JavaScript
21
star
16

better-internal-link-search

A WordPress plugin to improve the internal link popup functionality with time saving enhancements and features.
PHP
14
star
17

skip-link-focus

Make "skip to content" links more accessible.
JavaScript
12
star
18

ansible-deploy

An Ansible playbook for deploying a WordPress site from a git repository.
PHP
12
star
19

wp-nav-menus

Accessible, mobile-friendly navigation menus in WordPress themes.
JavaScript
12
star
20

simple-page-sidebars

A WordPress plugin for assigning custom sidebars to individual pages.
PHP
9
star
21

esformatter-wordpress

Format JavaScript according to the WordPress Coding Standards.
JavaScript
9
star
22

wp-theme-config

Shared configuration for our WordPress themes at Cedaro.
JavaScript
8
star
23

metamedia

A WordPress plugin to register media selection meta boxes.
PHP
8
star
24

youtube-embed-parameters

A WordPress plugin to customize parameters for embedded Youtube players.
PHP
7
star
25

microsite-themes

A WordPress plugin to load custom themes based on the URL.
PHP
7
star
26

themicons

Them icons.
HTML
7
star
27

footer-credits

A WordPress plugin for making theme footer credits editable.
PHP
6
star
28

customizer-customizer

A WordPress plugin to allow selected panels and sections to be hidden in the Customizer.
PHP
6
star
29

wavethumb

An experimental plugin demonstrating how to generate and save waveforms for audio attachments using the WordPress REST API.
JavaScript
6
star
30

load-project-config

JavaScript
3
star
31

embed-jetpack-custom-css

A WordPress plugin to embed Jetpack Custom CSS in the document head to improve performance.
PHP
2
star
32

extract-selectors

Extract and group selectors from a style sheet by property or value.
JavaScript
1
star
33

example-website

An example WordPress site managed with Composer.
PHP
1
star