Skip to content

Commit 4cae667

Browse files
authored
Create gpfup-set-jpeg-quality-for-uplodaed-images-all-forms.js
1 parent f78d637 commit 4cae667

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Gravity Perks // File Upload Pro // Set JPEG Quality for all Uploaded Images (All Forms)
4+
* https://gravitywiz.com/documentation/gravity-forms-file-upload-pro/
5+
*/
6+
add_action( 'gform_pre_enqueue_scripts', function( $form ) {
7+
if ( ! is_callable( 'gp_file_upload_pro' ) || ! gp_file_upload_pro()->should_enqueue_frontend( $form ) ) {
8+
return;
9+
}
10+
?>
11+
<script>
12+
window.gform.addFilter( 'gpfup_jpeg_quality', function () {
13+
// Update "1" to the desired quality. 1 represents 100%.
14+
return 1;
15+
} );
16+
</script>
17+
<?php
18+
} );

0 commit comments

Comments
 (0)