Description
Filter initialize config for the scanner powered by html5-qrcode.
Usage
gform.addFilter( 'gpqr_scanner_config', my_custom_function );
Parameters
– config object
Config used to initialize scanner.
instance object
Current instance of the
GP_QR_Code
class.supportedFormats array
Array of supported formats such as QR Code, PDF 417, etc. Provided as a way to pass in additional formats to the config.
scanTypes array
Array of scan types (camera and file). Provided as a way to change the scan types in the config.
Examples
Add Support for PDF_417 and UPC_A
/**
* Gravity Perks // GP QR Code // Add Support for PDF_417 and UPC_A
* https://gravitywiz.com/documentation/gravity-forms-qr-code/
*
* Instructions:
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-custom-javascript/
*/
window.gform.addFilter( 'gpqr_scanner_config', function( config, instance, formats ) {
config['formatsToSupport'] = [ formats.QR_CODE, formats.PDF_417, formats.UPC_A ];
return config;
} );
Since
This filter is available since Gravity Forms QR Code 1.0-alpha-1.