Completed
Pull Request — develop (#1639)
by
unknown
19:02
created
lightbox/fancybox/class-gravityview-lightbox-provider-fancybox.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -108,18 +108,18 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	public function allowed_atts( $atts = array() ) {
110 110
 
111
-		$atts['data-fancybox']         = null;
112
-		$atts['data-fancybox-trigger'] = null;
113
-		$atts['data-fancybox-index']   = null;
114
-		$atts['data-src']              = null;
115
-		$atts['data-type']             = null;
116
-		$atts['data-width']            = null;
117
-		$atts['data-height']           = null;
118
-		$atts['data-srcset']           = null;
119
-		$atts['data-caption']          = null;
120
-		$atts['data-options']          = null;
121
-		$atts['data-filter']           = null;
122
-		$atts['data-type']             = null;
111
+		$atts[ 'data-fancybox' ]         = null;
112
+		$atts[ 'data-fancybox-trigger' ] = null;
113
+		$atts[ 'data-fancybox-index' ]   = null;
114
+		$atts[ 'data-src' ]              = null;
115
+		$atts[ 'data-type' ]             = null;
116
+		$atts[ 'data-width' ]            = null;
117
+		$atts[ 'data-height' ]           = null;
118
+		$atts[ 'data-srcset' ]           = null;
119
+		$atts[ 'data-caption' ]          = null;
120
+		$atts[ 'data-options' ]          = null;
121
+		$atts[ 'data-filter' ]           = null;
122
+		$atts[ 'data-type' ]             = null;
123 123
 
124 124
 		return $atts;
125 125
 	}
@@ -134,30 +134,30 @@  discard block
 block discarded – undo
134 134
 		}
135 135
 
136 136
 		// Prevent empty content from getting added to the lightbox gallery
137
-		if ( is_array( $additional_details ) && empty( $additional_details['file_path'] ) ) {
137
+		if ( is_array( $additional_details ) && empty( $additional_details[ 'file_path' ] ) ) {
138 138
 			return $link_atts;
139 139
 		}
140 140
 
141 141
 		// Prevent empty content from getting added to the lightbox gallery
142
-		if ( is_array( $additional_details ) && ! empty( $additional_details['disable_lightbox'] ) ) {
142
+		if ( is_array( $additional_details ) && ! empty( $additional_details[ 'disable_lightbox' ] ) ) {
143 143
 			return $link_atts;
144 144
 		}
145 145
 
146
-		$link_atts['class'] = \GV\Utils::get( $link_atts, 'class' ) . ' gravityview-fancybox';
146
+		$link_atts[ 'class' ] = \GV\Utils::get( $link_atts, 'class' ) . ' gravityview-fancybox';
147 147
 
148
-		$link_atts['class'] = gravityview_sanitize_html_class( $link_atts['class'] );
148
+		$link_atts[ 'class' ] = gravityview_sanitize_html_class( $link_atts[ 'class' ] );
149 149
 
150 150
 		if ( $context && ! empty( $context->field->field ) ) {
151 151
 			if ( $context->field->field->multipleFiles ) {
152 152
 				$entry = $context->entry->as_entry();
153
-				$link_atts['data-fancybox'] = 'gallery-' . sprintf( "%s-%s-%s", $entry['form_id'], $context->field->ID, $context->entry->get_slug() );
153
+				$link_atts[ 'data-fancybox' ] = 'gallery-' . sprintf( "%s-%s-%s", $entry[ 'form_id' ], $context->field->ID, $context->entry->get_slug() );
154 154
 			}
155 155
 		}
156 156
 
157 157
 		$file_path = \GV\Utils::get( $additional_details, 'file_path' );
158 158
 		
159 159
 		if ( false !== strpos( $file_path, 'gv-iframe' ) ) {
160
-			$link_atts['data-type'] = 'pdf';
160
+			$link_atts[ 'data-type' ] = 'pdf';
161 161
 		}
162 162
 
163 163
 		return $link_atts;
Please login to merge, or discard this patch.