gpfup_meets_minimum_requirement (JS)
Description
Filter whether or not image meets minimum size requirement.
Usage
gform.addFilter( 'gpfup_meets_minimum_requirement', my_custom_function );
Parameters
meetsMinimum boolean
Whether or not image meets minimun size requirement.
imageSize Object
The current image size object
formId int
The current form ID
fieldId int
The current uploader field ID
gpfupInstance GPFUPField
Current File Upload Pro class instance
Examples
Honor either minimum requirement instead of requiring both
If uploaded image width or height is greater than the minimum width setting, then image meets minimum size requirement.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
* Gravity Perks // File Upload Pro // Enforce Minimum Width or Height
* https://gravitywiz.com/path/to/article/
*
* By default, the minimum width *and* height will be enforced. With this snippet you set a minimum width and enforce that for the width *or* height.
* For example, if you specify a minimum width of 1200px, this snippet would accept an image that is either 1200px wide or 1200px tall.
*
* Instructions:
*
* 1. Install this snippet with our free Code Chest plugin.
* https://gravitywiz.com/gravity-forms-code-chest/
*/
window.gform.addFilter( 'gpfup_meets_minimum_requirement', function ( meetsMinimum, imageSize, formId, fieldId, GPFUP ) {
if ( imageSize.width > GPFUP.minWidth || imageSize.height > GPFUP.minWidth ) {
return true;
}
return meetsMinimum;
} );
Since
This filter is available since Gravity Forms File Upload Pro 1.3.17
All Connections
All Perks
- GF Address Autocomplete
- GF Advanced Calculations
- GF Advanced Phone Field
- GF Advanced Save & Continue
- GF Advanced Select
- GF Auto List Field
- GF Auto Login
- GF Better User Activation
- GF Blocklist
- GF Bookings
- GF Conditional Logic Dates
- GF Conditional Pricing
- GF Copy Cat
- GF Date Time Calculator
- GF Disable Entry Creation
- GF Easy Passthrough
- GF eCommerce Fields
- GF Email Users
- GF Email Validator
- GF Entry Blocks
- GF Expand Textareas
- GF File Renamer
- GF File Upload Pro
- GF Inventory
- GF Limit Checkboxes
- GF Limit Dates
- GF Limit Submissions
- GF Live Preview
- GF Media Library
- GF Multi-Page Navigation
- GF Nested Forms
- GF Notification Scheduler
- GF Page Transitions
- GF Pay Per Word
- GF Populate Anything
- GF Post Content Merge Tags
- GF Preview Submission
- GF Price Range
- GF QR Code
- GF Randomizer
- GF Read Only
- GF Reload Form
- GF Submit to Access
- GF Terms Of Service
- GF Unique ID
- GF Word Count