Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/snaptortoise/gravity-forms-minmax

Adds MIN and MAX functions for Gravity Forms number field calculations
https://github.com/snaptortoise/gravity-forms-minmax

gravity-forms gravityforms minmax wordpress wordpress-plugin

Last synced: about 2 months ago
JSON representation

Adds MIN and MAX functions for Gravity Forms number field calculations

Awesome Lists containing this project

README

        

# Gravity Forms MIN/MAX Calculations

Adds MIN and MAX functions for Gravity Forms number field calculations.

[https://wordpress.org/plugins/gf-minmax-calculation/](https://wordpress.org/plugins/gf-minmax-calculation/)

## Description

This WordPress plugin adds `MIN()` and `MAX()` functions for Gravity Forms number fields calculations. It can be used to determine the highest or lowest value from any number of passed arguments, including merge tags.

## Examples

This will return the smaller of the four fields (inserted as merge tags) and proceed to divide it by 2:

`MIN({Field:1}, {Field:2}, {Field:3}, {Field:4}) / 2`

This will return the larger of two fields and proceed to multiply by 4:

`MAX({Field:1}, {Field:2}) * 4`

This will return either the value of a field (if above zero) or zero:

`MAX({Field:1}, 0)`

This will return either the value of a field (if below zero) or zero:

`MIN({Field:1}, 0)`

You can include calculations within the arguments themselves, for example

`MIN({Field:1} * 2, {Field:2} / 2)`

## Installation

### From the WordPress Admin Area

1. Download the plugin zip file from [https://wordpress.org/plugins/gf-minmax-calculation/](https://wordpress.org/plugins/gf-minmax-calculation/)
1. Log in to your WordPress admin area and navigate to the `Plugins` page
1. Click `Add New`, then click `Upload Plugin`
1. Click `Choose File`, then locate and select the plugin zip file
1. Click `Install Now`

### Using FTP

2. Upload the entire `gravityforms-minmax` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.

## Thanks

Thanks to [@michaeldozark](http://github.com/michaeldozark) for his [Gravity Forms exponents plugin](http://github.com/michaeldozark/gravityforms-exponents) which served as a good example of extending the built-in Gravity Forms calculation function.