gpfup_meets_minimum_requirement (JS)

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Honor either minimum requirement instead of requiring both
  5. Since

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.

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