WP Manifestindependent plugin directory
manifest / forms / wp-gravityforms-timber

Gravity Forms Timber WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

A wordpress plugin to ease timber integration with Gravity Forms

★ 6stars
v1.0.0-alpha.3latest · 8 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/generoi/wp-gravityforms-timber/archive/refs/heads/master.zip
Updates itself. It ships its own updater (Plugin Update Checker), so new versions appear under Dashboard → Updates.

A wordpress plugin to ease timber integration with Gravity Forms by suggesting twig templates and providing a JS layer to create submissions using the gravityformsrestapi plugin.

Requirements

Features

  • Provide form.twig, form--ID.twig template suggestions for all shortcode forms
  • Provides a Machine name setting for Gravity Form fields that can be used to fetch field meta easier than by ID
  • Supports both Gravity Form endpoints as well as general WP REST endpoints.
  • Provides inline field validation using Foundation markup.
  • Provides an option on a per-form basis to disable the Timber integration and use core Gravity Form logic instead.

Markup and Timber integration

The plugin does not come with any front-end, instead the theme should provide it. See generoi/sage for an example.

Other REST endpoints

You can use the AJAX form submission feature on any WP REST API endpoint. If you set data-ajax it will be initialized automatically, otherwise you can initialize it yourself through the JS constructor.

<form action="/wp-json/sage/v1/experiences" method="POST" data-ajax id="form--experiences">
  <!-- where error messages will be displayed (overridable) -->
  <div class="form__messages"></div>

  <p class="form__element">
    <label for="name">Name <span class="form-required">*</span></label>
    <input name="name" type="text" required>
  </p>
  <p class="form__element">
    <label for="email">Email <span class="form-required">*</span></label>
    <input name="email" type="email" required>
  </p>
  <input type="hidden" name="_wpnonce" value="{{fn('wp_create_nonce', 'wp_rest')}}">
  <input type="submit" value="Send">
</form>

<div class="form__confirmation is-hidden callout succcess">
  If available, this will be shown after the form has been submitted.
</div>

<script>
  // Alternative to the `form__confirmation` container, you can provide a JS
  // option specifying the confirmation action.
  window.formConfirmation = window.formConfirmation || {};
  window.formConfirmation['form--experiences'] = {
    // one of redirect|page|message
    'type': 'redirect',
    // where to redirect if `type` is set to `redirect` or `page`.
    'redirect': 'http://google.com',
    // Confirmation message to display (as an alternative to having it in the markup directly)
    'message': '<div class="callout">Success</div>'
  };
</script>

Options

Options can be passed in various ways. You can:

  1. Use the AjaxForm constructor directly

     new WP_Gravityforms_Timber.AjaxForm(el, options)
  2. Set options as data-arguments on the <form> element

     <form data-recaptcha>
  3. Filter the options through gravityforms-timber/options (see below).

Filter API

// Load recaptcha script.
add_filter('gravityforms-timber/options', function ($options) {
  $options['recaptcha'] = true;
});

/// Filter the template suggestions.
add_filter('gravityforms-timber/templates', function ($templates) {
  $templates[] = 'form--gform.twig';
  return $templates;
});

Releases

3 releases.

Tag
Published
Jan 12, 2018 8 years ago
Aug 7, 2017 9 years ago
Jul 20, 2017 9 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

A grade

Security

Gravity Forms Timber 1.0.0-alpha.3 · audited by WP Registry

No security issues found.

Audited release
1.0.0-alpha.3
Findings
none
Worst severity
—
Content hash
3b068840c7307470a80c8c53…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.