Skip to content

Commit 555bdf9

Browse files
committed
gpfup-display-images-in-entry-details.php: Updated to be class activated for better control.
1 parent c46f9a8 commit 555bdf9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

gp-file-upload-pro/gpfup-display-images-in-entry-details.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
* Instead of an unordered list with links to the files, display the images. Image previews will be hyperlinked to the
77
* original image.
88
*
9-
* Instructions: https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
9+
* Instructions:
10+
*
11+
* 1. Install the snippet.
12+
* https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
13+
* 2. Add the "gpfup-images-on-entry-detail" class to your field's Custom CSS Class setting.
1014
*/
1115
add_filter( 'gform_entry_field_value', function ( $display_value, $field, $entry, $form ) {
12-
if ( ! rgar( $field, 'multipleFiles' ) || ! rgar( $field, 'gpfupEnable' ) ) {
16+
17+
if ( strpos( $field->cssClass, 'gpfup-images-on-entry-detail' ) === false ) {
1318
return $display_value;
1419
}
1520

16-
/**
17-
* Set to false if the images should not be links.
18-
*/
19-
$link_images = true;
20-
2121
/**
2222
* @var string Value from the entry. Is JSON if files are provided.
2323
*/
2424
$entry_value = rgar( $entry, $field->id );
2525

2626
if ( ! $entry_value ) {
27-
return $entry_value;
27+
return $display_value;
2828
}
2929

3030
$file_urls = json_decode( $entry_value, true );

0 commit comments

Comments
 (0)