The gform_chainedselects_max_file_size filter allows you to control the max file size for imported Chained Select files in Gravity Forms.
Usage
add_filter('gform_chainedselects_max_file_size', 'your_function_name');
Parameters
- $size (int): The max file size in bytes.
More information
See Gravity Forms Docs: gform_chainedselects_max_file_size
Examples
Set max file size to 2MB
This example sets the maximum file size for imported Chained Select files to 2MB (2,000,000 bytes).
add_filter('gform_chainedselects_max_file_size', 'set_size_to_2mb'); function set_size_to_2mb($size) { return 2000000; // 2MB }
Set max file size to 1MB
This example sets the maximum file size for imported Chained Select files to 1MB (1,000,000 bytes).
add_filter('gform_chainedselects_max_file_size', 'set_size_to_1mb'); function set_size_to_1mb($size) { return 1000000; // 1MB }
Set max file size to 500KB
This example sets the maximum file size for imported Chained Select files to 500KB (500,000 bytes).
add_filter('gform_chainedselects_max_file_size', 'set_size_to_500kb'); function set_size_to_500kb($size) { return 500000; // 500KB }
Set max file size to 100KB
This example sets the maximum file size for imported Chained Select files to 100KB (100,000 bytes).
add_filter('gform_chainedselects_max_file_size', 'set_size_to_100kb'); function set_size_to_100kb($size) { return 100000; // 100KB }
Increase max file size by 50%
This example increases the maximum file size for imported Chained Select files by 50%.
add_filter('gform_chainedselects_max_file_size', 'increase_size_by_50_percent'); function increase_size_by_50_percent($size) { return $size * 1.5; // Increase by 50% }