Skip to content

Instantly share code, notes, and snippets.

View devlamconstructie's full-sized avatar

Willem de Vlam devlamconstructie

View GitHub Profile
<?php
/**
* Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
*
* Preview your Gravity forms on the frontend of your website. Adds a "Live Preview" link to the Gravity Forms toolbar.
*
* Usage
*
* 1 - Enable "Allow field to be populated dynamically" option on field which should be populated.
* 2 - In the "Parameter Name" input, enter the merge tag (or merge tags) of the field whose value whould be populated into this field.
<?php
/*
* HOW TO USE
* put in code snippet and activate.
* in oxygen, place text or header element inside a repeater,
* Use Insert Data -> PHP Function Return value
* enter the function name, example: p2o2_string
* enter the function parameters, separated by comma, example: my_relationship_field, user_nicename, 0, true
* planned: use -1 to iterate through all the related rows using a ( ... , ... and ...) format
* add checks for linked taxonomies; although those would not be necessary since they are already handled fine by O2.