Completed
Push — develop ( 580883...787cb1 )
by
unknown
28:31 queued 08:22
created
plugin-and-theme-hooks/abstract-gravityview-plugin-and-theme-hooks.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 	private function maybe_add_hooks() {
111 111
 		$class_exists = $this->class_name && class_exists( $this->class_name );
112 112
 		$function_exists = $this->function_name && function_exists( $this->function_name );
113
-		$constant_defined = $this->constant_name && defined("{$this->constant_name}");
113
+		$constant_defined = $this->constant_name && defined( "{$this->constant_name}" );
114 114
 
115
-		if( $class_exists || $function_exists || $constant_defined ) {
115
+		if ( $class_exists || $function_exists || $constant_defined ) {
116 116
 			$this->add_hooks();
117 117
 		}
118 118
 	}
@@ -124,23 +124,23 @@  discard block
 block discarded – undo
124 124
 	 */
125 125
 	protected function add_hooks() {
126 126
 
127
-		if( $this->meta_keys ) {
127
+		if ( $this->meta_keys ) {
128 128
 			add_filter( 'gravityview/data/parse/meta_keys', array( $this, 'merge_meta_keys' ), 10, 2 );
129 129
 		}
130 130
 
131
-		if( $this->content_meta_keys ) {
131
+		if ( $this->content_meta_keys ) {
132 132
 			add_filter( 'gravityview/view_collection/from_post/meta_keys', array( $this, 'merge_content_meta_keys' ), 10, 3 );
133 133
 		}
134 134
 
135
-		if( $this->script_handles ) {
135
+		if ( $this->script_handles ) {
136 136
 			add_filter( 'gravityview_noconflict_scripts', array( $this, 'merge_noconflict_scripts' ) );
137 137
 		}
138 138
 
139
-		if( $this->style_handles ) {
139
+		if ( $this->style_handles ) {
140 140
 			add_filter( 'gravityview_noconflict_styles', array( $this, 'merge_noconflict_styles' ) );
141 141
 		}
142 142
 
143
-		if( $this->post_type_support ) {
143
+		if ( $this->post_type_support ) {
144 144
 			add_filter( 'gravityview_post_type_support', array( $this, 'merge_post_type_support' ), 10, 2 );
145 145
 		}
146 146
 	}
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-theme-hooks-siteorigin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,19 +39,19 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	function merge_content_meta_keys( $meta_keys = array(), $post = null, & $views = null ) {
41 41
 
42
-		if( empty( $post->panels_data ) || empty( $post->panels_data['widgets'] ) ) {
42
+		if ( empty( $post->panels_data ) || empty( $post->panels_data[ 'widgets' ] ) ) {
43 43
 			return $meta_keys;
44 44
 		}
45 45
 
46
-		foreach ( (array) $post->panels_data['widgets'] as $widget ) {
46
+		foreach ( (array)$post->panels_data[ 'widgets' ] as $widget ) {
47 47
 
48 48
 			$views->merge( \GV\View_Collection::from_content( \GV\Utils::get( $widget, 'text' ) ) );
49 49
 
50
-			if ( empty( $widget['tabs'] ) || ! is_array( $widget['tabs'] ) ) {
50
+			if ( empty( $widget[ 'tabs' ] ) || ! is_array( $widget[ 'tabs' ] ) ) {
51 51
 				continue;
52 52
 			}
53 53
 
54
-			foreach ( $widget['tabs'] as $tab ) {
54
+			foreach ( $widget[ 'tabs' ] as $tab ) {
55 55
 
56 56
 				// Livemesh Tabs
57 57
 				$backup = \GV\Utils::get( $tab, 'tab_content' );
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 				// SiteOrigin Tabs
60 60
 				$content = \GV\Utils::get( $tab, 'content_text', $backup );
61 61
 
62
-				if( $content ) {
62
+				if ( $content ) {
63 63
 					$views->merge( \GV\View_Collection::from_content( $content ) );
64 64
 				}
65 65
 			}
Please login to merge, or discard this patch.
includes/plugin-and-theme-hooks/class-gravityview-plugin-hooks-acf.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 		$acf_keys = get_field_objects( $post->ID, array( 'load_value' => false ) );
57 57
 
58
-		if( $acf_keys ) {
58
+		if ( $acf_keys ) {
59 59
 			return array_merge( array_keys( $acf_keys ), $meta_keys );
60 60
 		}
61 61
 
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 	 * @return void
71 71
 	 */
72 72
 	private function fix_posted_fields() {
73
-		if( is_admin() && isset( $_POST['action'] ) && isset( $_POST['post_type'] ) ) {
74
-			if( 'editpost' === $_POST['action'] && 'gravityview' === $_POST['post_type'] ) {
75
-				$_POST['fields'] = _gravityview_process_posted_fields();
73
+		if ( is_admin() && isset( $_POST[ 'action' ] ) && isset( $_POST[ 'post_type' ] ) ) {
74
+			if ( 'editpost' === $_POST[ 'action' ] && 'gravityview' === $_POST[ 'post_type' ] ) {
75
+				$_POST[ 'fields' ] = _gravityview_process_posted_fields();
76 76
 			}
77 77
 		}
78 78
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-field-internal.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
 	 */
30 30
 	public static function from_configuration( $configuration ) {
31 31
 
32
-		if ( empty( $configuration['id'] ) || ! is_string( $configuration['id'] ) ) {
32
+		if ( empty( $configuration[ 'id' ] ) || ! is_string( $configuration[ 'id' ] ) ) {
33 33
 			gravityview()->log->error( 'Invalid configuration[id] supplied.' );
34 34
 			return null;
35 35
 		}
36 36
 
37
-		$field = self::by_id( $configuration['id'] );
37
+		$field = self::by_id( $configuration[ 'id' ] );
38 38
 
39 39
 		$field->update_configuration( $configuration );
40 40
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-list.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	public function remove_columns_from_searchable_fields( $fields ) {
61 61
 
62 62
 		foreach ( $fields as $key => $field ) {
63
-			if ( isset( $field['parent'] ) && $field['parent'] instanceof \GF_Field_List ) {
63
+			if ( isset( $field[ 'parent' ] ) && $field[ 'parent' ] instanceof \GF_Field_List ) {
64 64
 				unset( $fields[ $key ] );
65 65
 			}
66 66
 		}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		// Add the list columns
87 87
 		foreach ( $list_fields as $list_field ) {
88 88
 
89
-			if( empty( $list_field->enableColumns ) ) {
89
+			if ( empty( $list_field->enableColumns ) ) {
90 90
 				continue;
91 91
 			}
92 92
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 			}
108 108
 
109 109
 			// If there are columns, add them under the parent field
110
-			if( ! empty( $list_columns ) ) {
110
+			if ( ! empty( $list_columns ) ) {
111 111
 
112 112
 				$index = array_search( $list_field->id, array_keys( $fields ) ) + 1;
113 113
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 				 * Merge the $list_columns into the $fields array at $index
116 116
 				 * @see https://stackoverflow.com/a/1783125
117 117
 				 */
118
-				$fields = array_slice( $fields, 0, $index, true) + $list_columns + array_slice( $fields, $index, null, true);
118
+				$fields = array_slice( $fields, 0, $index, true ) + $list_columns + array_slice( $fields, $index, null, true );
119 119
 			}
120 120
 
121 121
 			unset( $list_columns, $index, $input_id );
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
 		$list_rows = maybe_unserialize( $field_value );
144 144
 
145
-		if( ! is_array( $list_rows ) ) {
145
+		if ( ! is_array( $list_rows ) ) {
146 146
 			gravityview()->log->error( '$field_value did not unserialize', array( 'data' => $field_value ) );
147 147
 			return null;
148 148
 		}
@@ -152,18 +152,18 @@  discard block
 block discarded – undo
152 152
 		// Each list row
153 153
 		foreach ( $list_rows as $list_row ) {
154 154
 			$current_column = 0;
155
-			foreach ( (array) $list_row as $column_key => $column_value ) {
155
+			foreach ( (array)$list_row as $column_key => $column_value ) {
156 156
 
157 157
 				// If the label of the column matches $column_id, or the numeric key value matches, add the value
158
-				if( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) {
159
-					$column_values[] = $column_value;
158
+				if ( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) {
159
+					$column_values[ ] = $column_value;
160 160
 				}
161 161
 				$current_column++;
162 162
 			}
163 163
 		}
164 164
 
165 165
 		// Return the array of values
166
-		if( 'raw' === $format ) {
166
+		if ( 'raw' === $format ) {
167 167
 			return $column_values;
168 168
 		}
169 169
 		// Return the Gravity Forms Field output
@@ -186,22 +186,22 @@  discard block
 block discarded – undo
186 186
 	 */
187 187
 	public function _filter_field_label( $label, $field, $form, $entry ) {
188 188
 
189
-		$field_object = RGFormsModel::get_field( $form, $field['id'] );
189
+		$field_object = RGFormsModel::get_field( $form, $field[ 'id' ] );
190 190
 
191 191
 		// Not a list field
192
-		if( ! $field_object || 'list' !== $field_object->type ) {
192
+		if ( ! $field_object || 'list' !== $field_object->type ) {
193 193
 			return $label;
194 194
 		}
195 195
 
196 196
 		// Custom label is defined, so use it
197
-		if( ! empty( $field['custom_label'] ) ) {
197
+		if ( ! empty( $field[ 'custom_label' ] ) ) {
198 198
 			return $label;
199 199
 		}
200 200
 
201
-		$column_id = gravityview_get_input_id_from_id( $field['id'] );
201
+		$column_id = gravityview_get_input_id_from_id( $field[ 'id' ] );
202 202
 
203 203
 		// Parent field, not column field
204
-		if( false === $column_id ) {
204
+		if ( false === $column_id ) {
205 205
 			return $label;
206 206
 		}
207 207
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	public static function get_column_label( GF_Field_List $field, $column_id, $backup_label = '' ) {
223 223
 
224 224
 		// Doesn't have columns enabled
225
-		if( ! isset( $field->choices ) || ! $field->enableColumns ) {
225
+		if ( ! isset( $field->choices ) || ! $field->enableColumns ) {
226 226
 			return $backup_label;
227 227
 		}
228 228
 
Please login to merge, or discard this patch.
includes/widgets/search-widget/class-search-widget.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -603,7 +603,8 @@  discard block
 block discarded – undo
603 603
 				// Fast-forward 24 hour on the end time
604 604
 				$curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS );
605 605
 				$search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
606
-				if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056
606
+				if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) {
607
+// See https://github.com/gravityview/GravityView/issues/1056
607 608
 					$search_criteria['end_date'] = date( 'Y-m-d H:i:s', strtotime( $search_criteria['end_date'] ) - 1 );
608 609
 				}
609 610
 			}
@@ -874,7 +875,7 @@  discard block
 block discarded – undo
874 875
 			'ymd_dot' => 'Y.m.d',
875 876
 		);
876 877
 
877
-		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){
878
+		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) {
878 879
 			$format = $datepicker[ $field->dateFormat ];
879 880
 		}
880 881
 
Please login to merge, or discard this patch.
Spacing   +186 added lines, -186 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 			'search_clear' => array(
56 56
 				'type'  => 'checkbox',
57 57
 				'label' => __( 'Show Clear button', 'gravityview' ),
58
-				'desc'  => __( 'When a search is performed, display a button that removes all search values.', 'gravityview'),
58
+				'desc'  => __( 'When a search is performed, display a button that removes all search values.', 'gravityview' ),
59 59
 				'value' => true,
60 60
 			),
61 61
 			'search_fields' => array(
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 				'type' => 'radio',
69 69
 				'full_width' => true,
70 70
 				'label' => esc_html__( 'Search Mode', 'gravityview' ),
71
-				'desc' => __('Should search results match all search fields, or any?', 'gravityview'),
71
+				'desc' => __( 'Should search results match all search fields, or any?', 'gravityview' ),
72 72
 				'value' => 'any',
73 73
 				'class' => 'hide-if-js',
74 74
 				'options' => array(
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 			// admin - add scripts - run at 1100 to make sure GravityView_Admin_Views::add_scripts_and_styles() runs first at 999
89 89
 			add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 1100 );
90
-			add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts') );
90
+			add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
91 91
 			add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) );
92 92
 
93 93
 			// ajax - get the searchable fields
@@ -123,19 +123,19 @@  discard block
 block discarded – undo
123 123
 	 */
124 124
 	public function add_reserved_args( $args ) {
125 125
 
126
-		$args[] = 'gv_search';
127
-		$args[] = 'gv_start';
128
-		$args[] = 'gv_end';
129
-		$args[] = 'gv_id';
130
-		$args[] = 'gv_by';
131
-		$args[] = 'mode';
126
+		$args[ ] = 'gv_search';
127
+		$args[ ] = 'gv_start';
128
+		$args[ ] = 'gv_end';
129
+		$args[ ] = 'gv_id';
130
+		$args[ ] = 'gv_by';
131
+		$args[ ] = 'mode';
132 132
 
133
-		$get = (array) $_GET;
133
+		$get = (array)$_GET;
134 134
 
135 135
 		// If the fields being searched as reserved; not to be considered user-passed variables
136 136
 		foreach ( $get as $key => $value ) {
137 137
 			if ( $key !== $this->convert_request_key_to_filter_key( $key ) ) {
138
-				$args[] = $key;
138
+				$args[ ] = $key;
139 139
 			}
140 140
 		}
141 141
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 		$script_min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
260 260
 		$script_source = empty( $script_min ) ? '/source' : '';
261 261
 
262
-		wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js'.$script_source.'/admin-search-widget'.$script_min.'.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), \GV\Plugin::$version );
262
+		wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js' . $script_source . '/admin-search-widget' . $script_min . '.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), \GV\Plugin::$version );
263 263
 
264 264
 		wp_localize_script( 'gravityview_searchwidget_admin', 'gvSearchVar', array(
265 265
 			'nonce' => wp_create_nonce( 'gravityview_ajaxsearchwidget' ),
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	 * @return array Scripts allowed in no-conflict mode, plus the search widget script
282 282
 	 */
283 283
 	public function register_no_conflict( $allowed ) {
284
-		$allowed[] = 'gravityview_searchwidget_admin';
284
+		$allowed[ ] = 'gravityview_searchwidget_admin';
285 285
 		return $allowed;
286 286
 	}
287 287
 
@@ -293,24 +293,24 @@  discard block
 block discarded – undo
293 293
 	 */
294 294
 	public static function get_searchable_fields() {
295 295
 
296
-		if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxsearchwidget' ) ) {
296
+		if ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'gravityview_ajaxsearchwidget' ) ) {
297 297
 			exit( '0' );
298 298
 		}
299 299
 
300 300
 		$form = '';
301 301
 
302 302
 		// Fetch the form for the current View
303
-		if ( ! empty( $_POST['view_id'] ) ) {
303
+		if ( ! empty( $_POST[ 'view_id' ] ) ) {
304 304
 
305
-			$form = gravityview_get_form_id( $_POST['view_id'] );
305
+			$form = gravityview_get_form_id( $_POST[ 'view_id' ] );
306 306
 
307
-		} elseif ( ! empty( $_POST['formid'] ) ) {
307
+		} elseif ( ! empty( $_POST[ 'formid' ] ) ) {
308 308
 
309
-			$form = (int) $_POST['formid'];
309
+			$form = (int)$_POST[ 'formid' ];
310 310
 
311
-		} elseif ( ! empty( $_POST['template_id'] ) && class_exists( 'GravityView_Ajax' ) ) {
311
+		} elseif ( ! empty( $_POST[ 'template_id' ] ) && class_exists( 'GravityView_Ajax' ) ) {
312 312
 
313
-			$form = GravityView_Ajax::pre_get_form_fields( $_POST['template_id'] );
313
+			$form = GravityView_Ajax::pre_get_form_fields( $_POST[ 'template_id' ] );
314 314
 
315 315
 		}
316 316
 
@@ -360,14 +360,14 @@  discard block
 block discarded – undo
360 360
 		);
361 361
 
362 362
 		if ( gravityview()->plugin->supports( \GV\Plugin::FEATURE_GFQUERY ) ) {
363
-			$custom_fields['is_approved'] = array(
363
+			$custom_fields[ 'is_approved' ] = array(
364 364
 				'text' => esc_html__( 'Approval Status', 'gravityview' ),
365 365
 				'type' => 'multi',
366 366
 			);
367 367
 		}
368 368
 
369
-		foreach( $custom_fields as $custom_field_key => $custom_field ) {
370
-			$output .= sprintf( '<option value="%s" %s data-inputtypes="%s" data-placeholder="%s">%s</option>', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field['type'], self::get_field_label( array('field' => $custom_field_key ) ), $custom_field['text'] );
369
+		foreach ( $custom_fields as $custom_field_key => $custom_field ) {
370
+			$output .= sprintf( '<option value="%s" %s data-inputtypes="%s" data-placeholder="%s">%s</option>', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field[ 'type' ], self::get_field_label( array( 'field' => $custom_field_key ) ), $custom_field[ 'text' ] );
371 371
 		}
372 372
 
373 373
 		// Get fields with sub-inputs and no parent
@@ -389,13 +389,13 @@  discard block
 block discarded – undo
389 389
 
390 390
 			foreach ( $fields as $id => $field ) {
391 391
 
392
-				if ( in_array( $field['type'], $blocklist_field_types ) ) {
392
+				if ( in_array( $field[ 'type' ], $blocklist_field_types ) ) {
393 393
 					continue;
394 394
 				}
395 395
 
396
-				$types = self::get_search_input_types( $id, $field['type'] );
396
+				$types = self::get_search_input_types( $id, $field[ 'type' ] );
397 397
 
398
-				$output .= '<option value="'. $id .'" '. selected( $id, $current, false ).'data-inputtypes="'. esc_attr( $types ) .'">'. esc_html( $field['label'] ) .'</option>';
398
+				$output .= '<option value="' . $id . '" ' . selected( $id, $current, false ) . 'data-inputtypes="' . esc_attr( $types ) . '">' . esc_html( $field[ 'label' ] ) . '</option>';
399 399
 			}
400 400
 		}
401 401
 
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 	public static function get_search_input_types( $field_id = '', $field_type = null ) {
419 419
 
420 420
 		// @todo - This needs to be improved - many fields have . including products and addresses
421
-		if ( false !== strpos( (string) $field_id, '.' ) && in_array( $field_type, array( 'checkbox' ) ) || in_array( $field_id, array( 'is_fulfilled' ) ) ) {
421
+		if ( false !== strpos( (string)$field_id, '.' ) && in_array( $field_type, array( 'checkbox' ) ) || in_array( $field_id, array( 'is_fulfilled' ) ) ) {
422 422
 			$input_type = 'boolean'; // on/off checkbox
423 423
 		} elseif ( in_array( $field_type, array( 'checkbox', 'post_category', 'multiselect' ) ) ) {
424 424
 			$input_type = 'multi'; //multiselect
@@ -464,19 +464,19 @@  discard block
 block discarded – undo
464 464
 			$post_id = 0;
465 465
 
466 466
 			// We're in the WordPress Widget context, and an overriding post ID has been set.
467
-			if ( ! empty( $widget_args['post_id'] ) ) {
468
-				$post_id = absint( $widget_args['post_id'] );
467
+			if ( ! empty( $widget_args[ 'post_id' ] ) ) {
468
+				$post_id = absint( $widget_args[ 'post_id' ] );
469 469
 			}
470 470
 			// We're in the WordPress Widget context, and the base View ID should be used
471
-			else if ( ! empty( $widget_args['view_id'] ) ) {
472
-				$post_id = absint( $widget_args['view_id'] );
471
+			else if ( ! empty( $widget_args[ 'view_id' ] ) ) {
472
+				$post_id = absint( $widget_args[ 'view_id' ] );
473 473
 			}
474 474
 
475 475
 			$args = gravityview_get_permalink_query_args( $post_id );
476 476
 
477 477
 			// Add hidden fields to the search form
478 478
 			foreach ( $args as $key => $value ) {
479
-				$search_fields[] = array(
479
+				$search_fields[ ] = array(
480 480
 					'name'  => $key,
481 481
 					'input' => 'hidden',
482 482
 					'value' => $value,
@@ -515,28 +515,28 @@  discard block
 block discarded – undo
515 515
 		/**
516 516
 		 * Include the sidebar Widgets.
517 517
 		 */
518
-		$widgets = (array) get_option( 'widget_gravityview_search', array() );
518
+		$widgets = (array)get_option( 'widget_gravityview_search', array() );
519 519
 
520 520
 		foreach ( $widgets as $widget ) {
521
-			if ( ! empty( $widget['view_id'] ) && $widget['view_id'] == $view->ID ) {
522
-				if( $_fields = json_decode( $widget['search_fields'], true ) ) {
521
+			if ( ! empty( $widget[ 'view_id' ] ) && $widget[ 'view_id' ] == $view->ID ) {
522
+				if ( $_fields = json_decode( $widget[ 'search_fields' ], true ) ) {
523 523
 					foreach ( $_fields as $field ) {
524
-						if ( empty( $field['form_id'] ) ) {
525
-							$field['form_id'] = $view->form ? $view->form->ID : 0;
524
+						if ( empty( $field[ 'form_id' ] ) ) {
525
+							$field[ 'form_id' ] = $view->form ? $view->form->ID : 0;
526 526
 						}
527
-						$searchable_fields[] = $with_full_field ? $field : $field['field'];
527
+						$searchable_fields[ ] = $with_full_field ? $field : $field[ 'field' ];
528 528
 					}
529 529
 				}
530 530
 			}
531 531
 		}
532 532
 
533 533
 		foreach ( $view->widgets->by_id( $this->get_widget_id() )->all() as $widget ) {
534
-			if( $_fields = json_decode( $widget->configuration->get( 'search_fields' ), true ) ) {
534
+			if ( $_fields = json_decode( $widget->configuration->get( 'search_fields' ), true ) ) {
535 535
 				foreach ( $_fields as $field ) {
536
-					if ( empty( $field['form_id'] ) ) {
537
-						$field['form_id'] = $view->form ? $view->form->ID : 0;
536
+					if ( empty( $field[ 'form_id' ] ) ) {
537
+						$field[ 'form_id' ] = $view->form ? $view->form->ID : 0;
538 538
 					}
539
-					$searchable_fields[] = $with_full_field ? $field : $field['field'];
539
+					$searchable_fields[ ] = $with_full_field ? $field : $field[ 'field' ];
540 540
 				}
541 541
 			}
542 542
 		}
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 			return $search_criteria; // Return the original criteria, GF_Query modification kicks in later
583 583
 		}
584 584
 
585
-		if( 'post' === $this->search_method ) {
585
+		if ( 'post' === $this->search_method ) {
586 586
 			$get = $_POST;
587 587
 		} else {
588 588
 			$get = $_GET;
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 		$get = gv_map_deep( $get, 'rawurldecode' );
602 602
 
603 603
 		// Make sure array key is set up
604
-		$search_criteria['field_filters'] = \GV\Utils::get( $search_criteria, 'field_filters', array() );
604
+		$search_criteria[ 'field_filters' ] = \GV\Utils::get( $search_criteria, 'field_filters', array() );
605 605
 
606 606
 		$searchable_fields = $this->get_view_searchable_fields( $view );
607 607
 		$searchable_field_objects = $this->get_view_searchable_fields( $view, true );
@@ -621,9 +621,9 @@  discard block
 block discarded – undo
621 621
 		$trim_search_value = apply_filters( 'gravityview/search-trim-input', true );
622 622
 
623 623
 		// add free search
624
-		if ( isset( $get['gv_search'] ) && '' !== $get['gv_search'] && in_array( 'search_all', $searchable_fields ) ) {
624
+		if ( isset( $get[ 'gv_search' ] ) && '' !== $get[ 'gv_search' ] && in_array( 'search_all', $searchable_fields ) ) {
625 625
 
626
-			$search_all_value = $trim_search_value ? trim( $get['gv_search'] ) : $get['gv_search'];
626
+			$search_all_value = $trim_search_value ? trim( $get[ 'gv_search' ] ) : $get[ 'gv_search' ];
627 627
 
628 628
 			if ( $split_words ) {
629 629
 				// Search for a piece
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 			}
640 640
 
641 641
 			foreach ( $words as $word ) {
642
-				$search_criteria['field_filters'][] = array(
642
+				$search_criteria[ 'field_filters' ][ ] = array(
643 643
 					'key' => null, // The field ID to search
644 644
 					'value' => $word, // The value to search
645 645
 					'operator' => 'contains', // What to search in. Options: `is` or `contains`
@@ -652,14 +652,14 @@  discard block
 block discarded – undo
652 652
 			/**
653 653
 			 * Get and normalize the dates according to the input format.
654 654
 			 */
655
-			if ( $curr_start = ! empty( $get['gv_start'] ) ? $get['gv_start'] : '' ) {
656
-				if( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) {
655
+			if ( $curr_start = ! empty( $get[ 'gv_start' ] ) ? $get[ 'gv_start' ] : '' ) {
656
+				if ( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) {
657 657
 					$curr_start = $curr_start_date->format( 'Y-m-d' );
658 658
 				}
659 659
 			}
660 660
 
661
-			if ( $curr_end = ! empty( $get['gv_start'] ) ? ( ! empty( $get['gv_end'] ) ? $get['gv_end'] : '' ) : '' ) {
662
-				if( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) {
661
+			if ( $curr_end = ! empty( $get[ 'gv_start' ] ) ? ( ! empty( $get[ 'gv_end' ] ) ? $get[ 'gv_end' ] : '' ) : '' ) {
662
+				if ( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) {
663 663
 					$curr_end = $curr_end_date->format( 'Y-m-d' );
664 664
 				}
665 665
 			}
@@ -695,22 +695,22 @@  discard block
 block discarded – undo
695 695
 			 */
696 696
 			if ( ! empty( $curr_start ) ) {
697 697
 				$curr_start = date( 'Y-m-d H:i:s', strtotime( $curr_start ) );
698
-				$search_criteria['start_date'] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
698
+				$search_criteria[ 'start_date' ] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
699 699
 			}
700 700
 
701 701
 			if ( ! empty( $curr_end ) ) {
702 702
 				// Fast-forward 24 hour on the end time
703 703
 				$curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS );
704
-				$search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
705
-				if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056
706
-					$search_criteria['end_date'] = date( 'Y-m-d H:i:s', strtotime( $search_criteria['end_date'] ) - 1 );
704
+				$search_criteria[ 'end_date' ] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
705
+				if ( strpos( $search_criteria[ 'end_date' ], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056
706
+					$search_criteria[ 'end_date' ] = date( 'Y-m-d H:i:s', strtotime( $search_criteria[ 'end_date' ] ) - 1 );
707 707
 				}
708 708
 			}
709 709
 		}
710 710
 
711 711
 		// search for a specific entry ID
712 712
 		if ( ! empty( $get[ 'gv_id' ] ) && in_array( 'entry_id', $searchable_fields ) ) {
713
-			$search_criteria['field_filters'][] = array(
713
+			$search_criteria[ 'field_filters' ][ ] = array(
714 714
 				'key' => 'id',
715 715
 				'value' => absint( $get[ 'gv_id' ] ),
716 716
 				'operator' => $this->get_operator( $get, 'gv_id', array( '=' ), '=' ),
@@ -719,15 +719,15 @@  discard block
 block discarded – undo
719 719
 
720 720
 		// search for a specific Created_by ID
721 721
 		if ( ! empty( $get[ 'gv_by' ] ) && in_array( 'created_by', $searchable_fields ) ) {
722
-			$search_criteria['field_filters'][] = array(
722
+			$search_criteria[ 'field_filters' ][ ] = array(
723 723
 				'key' => 'created_by',
724
-				'value' => $get['gv_by'],
724
+				'value' => $get[ 'gv_by' ],
725 725
 				'operator' => $this->get_operator( $get, 'gv_by', array( '=' ), '=' ),
726 726
 			);
727 727
 		}
728 728
 
729 729
 		// Get search mode passed in URL
730
-		$mode = isset( $get['mode'] ) && in_array( $get['mode'], array( 'any', 'all' ) ) ?  $get['mode'] : 'any';
730
+		$mode = isset( $get[ 'mode' ] ) && in_array( $get[ 'mode' ], array( 'any', 'all' ) ) ? $get[ 'mode' ] : 'any';
731 731
 
732 732
 		// get the other search filters
733 733
 		foreach ( $get as $key => $value ) {
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 				$value = is_array( $value ) ? array_map( 'trim', $value ) : trim( $value );
740 740
 			}
741 741
 
742
-			if ( gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[0], false, false ) ) ) {
742
+			if ( gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[ 0 ], false, false ) ) ) {
743 743
 				continue;
744 744
 			}
745 745
 
@@ -753,21 +753,21 @@  discard block
 block discarded – undo
753 753
 				continue;
754 754
 			}
755 755
 
756
-			if ( ! isset( $filter['operator'] ) ) {
757
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
756
+			if ( ! isset( $filter[ 'operator' ] ) ) {
757
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
758 758
 			}
759 759
 
760
-			if ( isset( $filter[0]['value'] ) ) {
761
-				$filter[0]['value'] = $trim_search_value ? trim( $filter[0]['value'] ) : $filter[0]['value'];
760
+			if ( isset( $filter[ 0 ][ 'value' ] ) ) {
761
+				$filter[ 0 ][ 'value' ] = $trim_search_value ? trim( $filter[ 0 ][ 'value' ] ) : $filter[ 0 ][ 'value' ];
762 762
 
763
-				$search_criteria['field_filters'] = array_merge( $search_criteria['field_filters'], $filter );
763
+				$search_criteria[ 'field_filters' ] = array_merge( $search_criteria[ 'field_filters' ], $filter );
764 764
 
765 765
 				// if date range type, set search mode to ALL
766
-				if ( ! empty( $filter[0]['operator'] ) && in_array( $filter[0]['operator'], array( '>=', '<=', '>', '<' ) ) ) {
766
+				if ( ! empty( $filter[ 0 ][ 'operator' ] ) && in_array( $filter[ 0 ][ 'operator' ], array( '>=', '<=', '>', '<' ) ) ) {
767 767
 					$mode = 'all';
768 768
 				}
769
-			} elseif( !empty( $filter ) ) {
770
-				$search_criteria['field_filters'][] = $filter;
769
+			} elseif ( ! empty( $filter ) ) {
770
+				$search_criteria[ 'field_filters' ][ ] = $filter;
771 771
 			}
772 772
 		}
773 773
 
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 		 * @since 1.5.1
777 777
 		 * @param[out,in] string $mode Search mode (`any` vs `all`)
778 778
 		 */
779
-		$search_criteria['field_filters']['mode'] = apply_filters( 'gravityview/search/mode', $mode );
779
+		$search_criteria[ 'field_filters' ][ 'mode' ] = apply_filters( 'gravityview/search/mode', $mode );
780 780
 
781 781
 		gravityview()->log->debug( 'Returned Search Criteria: ', array( 'data' => $search_criteria ) );
782 782
 
@@ -810,19 +810,19 @@  discard block
 block discarded – undo
810 810
 
811 811
 		$query_class = $view->get_query_class();
812 812
 
813
-		if ( empty( $search_criteria['field_filters'] ) ) {
813
+		if ( empty( $search_criteria[ 'field_filters' ] ) ) {
814 814
 			return;
815 815
 		}
816 816
 
817 817
 		$widgets = $view->widgets->by_id( $this->widget_id );
818 818
 		if ( $widgets->count() ) {
819 819
 			$widgets = $widgets->all();
820
-			$widget  = $widgets[0];
820
+			$widget  = $widgets[ 0 ];
821 821
 
822 822
 			$search_fields = json_decode( $widget->configuration->get( 'search_fields' ), true );
823 823
 
824
-			foreach ( (array) $search_fields as $search_field ) {
825
-				if ( 'created_by' === $search_field['field'] && 'input_text' === $search_field['input'] ) {
824
+			foreach ( (array)$search_fields as $search_field ) {
825
+				if ( 'created_by' === $search_field[ 'field' ] && 'input_text' === $search_field[ 'input' ] ) {
826 826
 					$created_by_text_mode = true;
827 827
 				}
828 828
 			}
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 		$extra_conditions = array();
832 832
 		$mode = 'any';
833 833
 
834
-		foreach ( $search_criteria['field_filters'] as &$filter ) {
834
+		foreach ( $search_criteria[ 'field_filters' ] as &$filter ) {
835 835
 			if ( ! is_array( $filter ) ) {
836 836
 				if ( in_array( strtolower( $filter ), array( 'any', 'all' ) ) ) {
837 837
 					$mode = $filter;
@@ -840,13 +840,13 @@  discard block
 block discarded – undo
840 840
 			}
841 841
 
842 842
 			// Construct a manual query for unapproved statuses
843
-			if ( 'is_approved' === $filter['key'] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array) $filter['value'] ) ) {
844
-				$_tmp_query       = new $query_class( $view->form->ID, array(
843
+			if ( 'is_approved' === $filter[ 'key' ] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array)$filter[ 'value' ] ) ) {
844
+				$_tmp_query = new $query_class( $view->form->ID, array(
845 845
 					'field_filters' => array(
846 846
 						array(
847 847
 							'operator' => 'in',
848 848
 							'key'      => 'is_approved',
849
-							'value'    => (array) $filter['value'],
849
+							'value'    => (array)$filter[ 'value' ],
850 850
 						),
851 851
 						array(
852 852
 							'operator' => 'is',
@@ -858,30 +858,30 @@  discard block
 block discarded – undo
858 858
 				) );
859 859
 				$_tmp_query_parts = $_tmp_query->_introspect();
860 860
 
861
-				$extra_conditions[] = $_tmp_query_parts['where'];
861
+				$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
862 862
 
863 863
 				$filter = false;
864 864
 				continue;
865 865
 			}
866 866
 
867 867
 			// Construct manual query for text mode creator search
868
-			if ( 'created_by' === $filter['key'] && ! empty( $created_by_text_mode ) ) {
869
-				$extra_conditions[] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
868
+			if ( 'created_by' === $filter[ 'key' ] && ! empty( $created_by_text_mode ) ) {
869
+				$extra_conditions[ ] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
870 870
 				$filter = false;
871 871
 				continue;
872 872
 			}
873 873
 
874 874
 			// By default, we want searches to be wildcard for each field.
875
-			$filter['operator'] = empty( $filter['operator'] ) ? 'contains' : $filter['operator'];
875
+			$filter[ 'operator' ] = empty( $filter[ 'operator' ] ) ? 'contains' : $filter[ 'operator' ];
876 876
 
877 877
 			// For multichoice, let's have an in (OR) search.
878
-			if ( is_array( $filter['value'] ) ) {
879
-				$filter['operator'] = 'in'; // @todo what about in contains (OR LIKE chains)?
878
+			if ( is_array( $filter[ 'value' ] ) ) {
879
+				$filter[ 'operator' ] = 'in'; // @todo what about in contains (OR LIKE chains)?
880 880
 			}
881 881
 
882 882
 			// Default form with joins functionality
883
-			if ( empty( $filter['form_id'] ) ) {
884
-				$filter['form_id'] = $view->form ? $view->form->ID : 0;
883
+			if ( empty( $filter[ 'form_id' ] ) ) {
884
+				$filter[ 'form_id' ] = $view->form ? $view->form->ID : 0;
885 885
 			}
886 886
 
887 887
 			/**
@@ -891,28 +891,28 @@  discard block
 block discarded – undo
891 891
 			 * @param array $filter array with `key`, `value`, `operator`, `type` keys
892 892
 			 * @param \GV\View $view The View we're operating on.
893 893
 			 */
894
-			$filter['operator'] = apply_filters( 'gravityview_search_operator', $filter['operator'], $filter, $view );
894
+			$filter[ 'operator' ] = apply_filters( 'gravityview_search_operator', $filter[ 'operator' ], $filter, $view );
895 895
 		}
896 896
 
897
-		if ( ! empty( $search_criteria['start_date'] ) || ! empty( $search_criteria['end_date'] ) ) {
897
+		if ( ! empty( $search_criteria[ 'start_date' ] ) || ! empty( $search_criteria[ 'end_date' ] ) ) {
898 898
 			$date_criteria = array();
899 899
 
900
-			if ( isset( $search_criteria['start_date'] ) ) {
901
-				$date_criteria['start_date'] = $search_criteria['start_date'];
900
+			if ( isset( $search_criteria[ 'start_date' ] ) ) {
901
+				$date_criteria[ 'start_date' ] = $search_criteria[ 'start_date' ];
902 902
 			}
903 903
 
904
-			if ( isset( $search_criteria['end_date'] ) ) {
905
-				$date_criteria['end_date'] = $search_criteria['end_date'];
904
+			if ( isset( $search_criteria[ 'end_date' ] ) ) {
905
+				$date_criteria[ 'end_date' ] = $search_criteria[ 'end_date' ];
906 906
 			}
907 907
 
908 908
 			$_tmp_query         = new $query_class( $view->form->ID, $date_criteria );
909 909
 			$_tmp_query_parts   = $_tmp_query->_introspect();
910
-			$extra_conditions[] = $_tmp_query_parts['where'];
910
+			$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
911 911
 		}
912 912
 
913 913
 		$search_conditions = array();
914 914
 
915
-		if ( $filters = array_filter( $search_criteria['field_filters'] ) ) {
915
+		if ( $filters = array_filter( $search_criteria[ 'field_filters' ] ) ) {
916 916
 			foreach ( $filters as &$filter ) {
917 917
 				if ( ! is_array( $filter ) ) {
918 918
 					continue;
@@ -924,12 +924,12 @@  discard block
 block discarded – undo
924 924
 				 * code by reusing what's inside GF_Query already as they
925 925
 				 * take care of many small things like forcing numeric, etc.
926 926
 				 */
927
-				$_tmp_query       = new $query_class( $filter['form_id'], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
927
+				$_tmp_query       = new $query_class( $filter[ 'form_id' ], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
928 928
 				$_tmp_query_parts = $_tmp_query->_introspect();
929
-				$search_condition = $_tmp_query_parts['where'];
929
+				$search_condition = $_tmp_query_parts[ 'where' ];
930 930
 
931
-				if ( empty( $filter['key'] ) && $search_condition->expressions ) {
932
-					$search_conditions[] = $search_condition;
931
+				if ( empty( $filter[ 'key' ] ) && $search_condition->expressions ) {
932
+					$search_conditions[ ] = $search_condition;
933 933
 				} else {
934 934
 					$left = $search_condition->left;
935 935
 					$alias = $query->_alias( $left->field_id, $left->source, $left->is_entry_column() ? 't' : 'm' );
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 							$on = $_join->join_on;
940 940
 							$join = $_join->join;
941 941
 
942
-							$search_conditions[] = GF_Query_Condition::_or(
942
+							$search_conditions[ ] = GF_Query_Condition::_or(
943 943
 								// Join
944 944
 								new GF_Query_Condition(
945 945
 									new GF_Query_Column( GF_Query_Column::META, $join->ID, $query->_alias( GF_Query_Column::META, $join->ID, 'm' ) ),
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
 							);
956 956
 						}
957 957
 					} else {
958
-						$search_conditions[] = new GF_Query_Condition(
958
+						$search_conditions[ ] = new GF_Query_Condition(
959 959
 							new GF_Query_Column( $left->field_id, $left->source, $alias ),
960 960
 							$search_condition->operator,
961 961
 							$search_condition->right
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
 		/**
978 978
 		 * Combine the parts as a new WHERE clause.
979 979
 		 */
980
-		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts['where'] ), $search_conditions, $extra_conditions ) );
980
+		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts[ 'where' ] ), $search_conditions, $extra_conditions ) );
981 981
 		$query->where( $where );
982 982
 	}
983 983
 
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 		$field_id = str_replace( 'filter_', '', $key );
1001 1001
 
1002 1002
 		// calculates field_id, removing 'filter_' and for '_' for advanced fields ( like name or checkbox )
1003
-		if ( preg_match('/^[0-9_]+$/ism', $field_id ) ) {
1003
+		if ( preg_match( '/^[0-9_]+$/ism', $field_id ) ) {
1004 1004
 			$field_id = str_replace( '_', '.', $field_id );
1005 1005
 		}
1006 1006
 
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 			// form is in searchable fields
1058 1058
 			$found = false;
1059 1059
 			foreach ( $searchable_fields as $field ) {
1060
-				if ( $field_id == $field['field'] && $form->ID == $field['form_id'] ) {
1060
+				if ( $field_id == $field[ 'field' ] && $form->ID == $field[ 'form_id' ] ) {
1061 1061
 					$found = true;
1062 1062
 					break;
1063 1063
 				}
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 
1098 1098
 			case 'select':
1099 1099
 			case 'radio':
1100
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1100
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1101 1101
 				break;
1102 1102
 
1103 1103
 			case 'post_category':
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 
1112 1112
 				foreach ( $value as $val ) {
1113 1113
 					$cat = get_term( $val, 'category' );
1114
-					$filter[] = array(
1114
+					$filter[ ] = array(
1115 1115
 						'key'      => $field_id,
1116 1116
 						'value'    => esc_attr( $cat->name ) . ':' . $val,
1117 1117
 						'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
 				$filter = array();
1131 1131
 
1132 1132
 				foreach ( $value as $val ) {
1133
-					$filter[] = array( 'key' => $field_id, 'value' => $val );
1133
+					$filter[ ] = array( 'key' => $field_id, 'value' => $val );
1134 1134
 				}
1135 1135
 
1136 1136
 				break;
@@ -1139,9 +1139,9 @@  discard block
 block discarded – undo
1139 1139
 				// convert checkbox on/off into the correct search filter
1140 1140
 				if ( false !== strpos( $field_id, '.' ) && ! empty( $form_field->inputs ) && ! empty( $form_field->choices ) ) {
1141 1141
 					foreach ( $form_field->inputs as $k => $input ) {
1142
-						if ( $input['id'] == $field_id ) {
1143
-							$filter['value'] = $form_field->choices[ $k ]['value'];
1144
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1142
+						if ( $input[ 'id' ] == $field_id ) {
1143
+							$filter[ 'value' ] = $form_field->choices[ $k ][ 'value' ];
1144
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1145 1145
 							break;
1146 1146
 						}
1147 1147
 					}
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
 					$filter = array();
1152 1152
 
1153 1153
 					foreach ( $value as $val ) {
1154
-						$filter[] = array(
1154
+						$filter[ ] = array(
1155 1155
 							'key'      => $field_id,
1156 1156
 							'value'    => $val,
1157 1157
 							'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1172,9 +1172,9 @@  discard block
 block discarded – undo
1172 1172
 					foreach ( $words as $word ) {
1173 1173
 						if ( ! empty( $word ) && strlen( $word ) > 1 ) {
1174 1174
 							// Keep the same key for each filter
1175
-							$filter['value'] = $word;
1175
+							$filter[ 'value' ] = $word;
1176 1176
 							// Add a search for the value
1177
-							$filters[] = $filter;
1177
+							$filters[ ] = $filter;
1178 1178
 						}
1179 1179
 					}
1180 1180
 
@@ -1188,19 +1188,19 @@  discard block
 block discarded – undo
1188 1188
 
1189 1189
 					foreach ( $searchable_fields as $searchable_field ) {
1190 1190
 
1191
-						if( $form_field->ID !== $searchable_field['field'] ) {
1191
+						if ( $form_field->ID !== $searchable_field[ 'field' ] ) {
1192 1192
 							continue;
1193 1193
 						}
1194 1194
 
1195 1195
 						// Only exact-match dropdowns, not text search
1196
-						if( in_array( $searchable_field['input'], array( 'text', 'search' ), true ) ) {
1196
+						if ( in_array( $searchable_field[ 'input' ], array( 'text', 'search' ), true ) ) {
1197 1197
 							continue;
1198 1198
 						}
1199 1199
 
1200 1200
 						$input_id = gravityview_get_input_id_from_id( $form_field->ID );
1201 1201
 
1202 1202
 						if ( 4 === $input_id ) {
1203
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1203
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1204 1204
 						};
1205 1205
 					}
1206 1206
 				}
@@ -1228,12 +1228,12 @@  discard block
 block discarded – undo
1228 1228
 						 * @since 1.16.3
1229 1229
 						 * Safeguard until GF implements '<=' operator
1230 1230
 						 */
1231
-						if( !GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1231
+						if ( ! GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1232 1232
 							$operator = '<';
1233 1233
 							$date = date( 'Y-m-d', strtotime( self::get_formatted_date( $date, 'Y-m-d', $date_format ) . ' +1 day' ) );
1234 1234
 						}
1235 1235
 
1236
-						$filter[] = array(
1236
+						$filter[ ] = array(
1237 1237
 							'key'      => $field_id,
1238 1238
 							'value'    => self::get_formatted_date( $date, 'Y-m-d', $date_format ),
1239 1239
 							'operator' => $this->get_operator( $get, $key, array( $operator ), $operator ),
@@ -1241,12 +1241,12 @@  discard block
 block discarded – undo
1241 1241
 					}
1242 1242
 				} else {
1243 1243
 					$date = $value;
1244
-					$filter['value'] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1245
-					$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1244
+					$filter[ 'value' ] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1245
+					$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1246 1246
 				}
1247 1247
 
1248
-				if ('payment_date' === $key) {
1249
-					$filter['operator'] = 'contains';
1248
+				if ( 'payment_date' === $key ) {
1249
+					$filter[ 'operator' ] = 'contains';
1250 1250
 				}
1251 1251
 
1252 1252
 				break;
@@ -1275,7 +1275,7 @@  discard block
 block discarded – undo
1275 1275
 			'ymd_dot' => 'Y.m.d',
1276 1276
 		);
1277 1277
 
1278
-		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){
1278
+		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) {
1279 1279
 			$format = $datepicker[ $field->dateFormat ];
1280 1280
 		}
1281 1281
 
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
 	public function add_template_path( $file_paths ) {
1313 1313
 
1314 1314
 		// Index 100 is the default GravityView template path.
1315
-		$file_paths[102] = self::$file . 'templates/';
1315
+		$file_paths[ 102 ] = self::$file . 'templates/';
1316 1316
 
1317 1317
 		return $file_paths;
1318 1318
 	}
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
 		$has_date = false;
1332 1332
 
1333 1333
 		foreach ( $search_fields as $k => $field ) {
1334
-			if ( in_array( $field['input'], array( 'date', 'date_range', 'entry_date' ) ) ) {
1334
+			if ( in_array( $field[ 'input' ], array( 'date', 'date_range', 'entry_date' ) ) ) {
1335 1335
 				$has_date = true;
1336 1336
 				break;
1337 1337
 			}
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
 		$view = \GV\View::by_id( $gravityview_view->view_id );
1361 1361
 
1362 1362
 		// get configured search fields
1363
-		$search_fields = ! empty( $widget_args['search_fields'] ) ? json_decode( $widget_args['search_fields'], true ) : '';
1363
+		$search_fields = ! empty( $widget_args[ 'search_fields' ] ) ? json_decode( $widget_args[ 'search_fields' ], true ) : '';
1364 1364
 
1365 1365
 		if ( empty( $search_fields ) || ! is_array( $search_fields ) ) {
1366 1366
 			gravityview()->log->debug( 'No search fields configured for widget:', array( 'data' => $widget_args ) );
@@ -1374,39 +1374,39 @@  discard block
 block discarded – undo
1374 1374
 
1375 1375
 			$updated_field = $this->get_search_filter_details( $updated_field, $context );
1376 1376
 
1377
-			switch ( $field['field'] ) {
1377
+			switch ( $field[ 'field' ] ) {
1378 1378
 
1379 1379
 				case 'search_all':
1380
-					$updated_field['key'] = 'search_all';
1381
-					$updated_field['input'] = 'search_all';
1382
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_search' );
1380
+					$updated_field[ 'key' ] = 'search_all';
1381
+					$updated_field[ 'input' ] = 'search_all';
1382
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_search' );
1383 1383
 					break;
1384 1384
 
1385 1385
 				case 'entry_date':
1386
-					$updated_field['key'] = 'entry_date';
1387
-					$updated_field['input'] = 'entry_date';
1388
-					$updated_field['value'] = array(
1386
+					$updated_field[ 'key' ] = 'entry_date';
1387
+					$updated_field[ 'input' ] = 'entry_date';
1388
+					$updated_field[ 'value' ] = array(
1389 1389
 						'start' => $this->rgget_or_rgpost( 'gv_start' ),
1390 1390
 						'end' => $this->rgget_or_rgpost( 'gv_end' ),
1391 1391
 					);
1392 1392
 					break;
1393 1393
 
1394 1394
 				case 'entry_id':
1395
-					$updated_field['key'] = 'entry_id';
1396
-					$updated_field['input'] = 'entry_id';
1397
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_id' );
1395
+					$updated_field[ 'key' ] = 'entry_id';
1396
+					$updated_field[ 'input' ] = 'entry_id';
1397
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_id' );
1398 1398
 					break;
1399 1399
 
1400 1400
 				case 'created_by':
1401
-					$updated_field['key'] = 'created_by';
1402
-					$updated_field['name'] = 'gv_by';
1403
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_by' );
1401
+					$updated_field[ 'key' ] = 'created_by';
1402
+					$updated_field[ 'name' ] = 'gv_by';
1403
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_by' );
1404 1404
 					break;
1405 1405
 
1406 1406
 				case 'is_approved':
1407
-					$updated_field['key'] = 'is_approved';
1408
-					$updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_approved' );
1409
-					$updated_field['choices'] = self::get_is_approved_choices();
1407
+					$updated_field[ 'key' ] = 'is_approved';
1408
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'filter_is_approved' );
1409
+					$updated_field[ 'choices' ] = self::get_is_approved_choices();
1410 1410
 					break;
1411 1411
 			}
1412 1412
 
@@ -1427,16 +1427,16 @@  discard block
 block discarded – undo
1427 1427
 
1428 1428
 		$gravityview_view->permalink_fields = $this->add_no_permalink_fields( array(), $this, $widget_args );
1429 1429
 
1430
-		$gravityview_view->search_layout = ! empty( $widget_args['search_layout'] ) ? $widget_args['search_layout'] : 'horizontal';
1430
+		$gravityview_view->search_layout = ! empty( $widget_args[ 'search_layout' ] ) ? $widget_args[ 'search_layout' ] : 'horizontal';
1431 1431
 
1432 1432
 		/** @since 1.14 */
1433
-		$gravityview_view->search_mode = ! empty( $widget_args['search_mode'] ) ? $widget_args['search_mode'] : 'any';
1433
+		$gravityview_view->search_mode = ! empty( $widget_args[ 'search_mode' ] ) ? $widget_args[ 'search_mode' ] : 'any';
1434 1434
 
1435
-		$custom_class = ! empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
1435
+		$custom_class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
1436 1436
 
1437 1437
 		$gravityview_view->search_class = self::get_search_class( $custom_class );
1438 1438
 
1439
-		$gravityview_view->search_clear = ! empty( $widget_args['search_clear'] ) ? $widget_args['search_clear'] : false;
1439
+		$gravityview_view->search_clear = ! empty( $widget_args[ 'search_clear' ] ) ? $widget_args[ 'search_clear' ] : false;
1440 1440
 
1441 1441
 		if ( $this->has_date_field( $search_fields ) ) {
1442 1442
 			// enqueue datepicker stuff only if needed!
@@ -1458,10 +1458,10 @@  discard block
 block discarded – undo
1458 1458
 	public static function get_search_class( $custom_class = '' ) {
1459 1459
 		$gravityview_view = GravityView_View::getInstance();
1460 1460
 
1461
-		$search_class = 'gv-search-'.$gravityview_view->search_layout;
1461
+		$search_class = 'gv-search-' . $gravityview_view->search_layout;
1462 1462
 
1463
-		if ( ! empty( $custom_class )  ) {
1464
-			$search_class .= ' '.$custom_class;
1463
+		if ( ! empty( $custom_class ) ) {
1464
+			$search_class .= ' ' . $custom_class;
1465 1465
 		}
1466 1466
 
1467 1467
 		/**
@@ -1512,9 +1512,9 @@  discard block
 block discarded – undo
1512 1512
 
1513 1513
 		if ( ! $label ) {
1514 1514
 
1515
-			$label = isset( $form_field['label'] ) ? $form_field['label'] : '';
1515
+			$label = isset( $form_field[ 'label' ] ) ? $form_field[ 'label' ] : '';
1516 1516
 
1517
-			switch( $field['field'] ) {
1517
+			switch ( $field[ 'field' ] ) {
1518 1518
 				case 'search_all':
1519 1519
 					$label = __( 'Search Entries:', 'gravityview' );
1520 1520
 					break;
@@ -1526,10 +1526,10 @@  discard block
 block discarded – undo
1526 1526
 					break;
1527 1527
 				default:
1528 1528
 					// If this is a field input, not a field
1529
-					if ( strpos( $field['field'], '.' ) > 0 && ! empty( $form_field['inputs'] ) ) {
1529
+					if ( strpos( $field[ 'field' ], '.' ) > 0 && ! empty( $form_field[ 'inputs' ] ) ) {
1530 1530
 
1531 1531
 						// Get the label for the field in question, which returns an array
1532
-						$items = wp_list_filter( $form_field['inputs'], array( 'id' => $field['field'] ) );
1532
+						$items = wp_list_filter( $form_field[ 'inputs' ], array( 'id' => $field[ 'field' ] ) );
1533 1533
 
1534 1534
 						// Get the item with the `label` key
1535 1535
 						$values = wp_list_pluck( $items, 'label' );
@@ -1570,13 +1570,13 @@  discard block
 block discarded – undo
1570 1570
 		$form = $gravityview_view->getForm();
1571 1571
 
1572 1572
 		// for advanced field ids (eg, first name / last name )
1573
-		$name = 'filter_' . str_replace( '.', '_', $field['field'] );
1573
+		$name = 'filter_' . str_replace( '.', '_', $field[ 'field' ] );
1574 1574
 
1575 1575
 		// get searched value from $_GET/$_POST (string or array)
1576 1576
 		$value = $this->rgget_or_rgpost( $name );
1577 1577
 
1578 1578
 		// get form field details
1579
-		$form_field = gravityview_get_field( $form, $field['field'] );
1579
+		$form_field = gravityview_get_field( $form, $field[ 'field' ] );
1580 1580
 
1581 1581
 		$form_field_type = \GV\Utils::get( $form_field, 'type' );
1582 1582
 
@@ -1590,22 +1590,22 @@  discard block
 block discarded – undo
1590 1590
 		);
1591 1591
 
1592 1592
 		// collect choices
1593
-		if ( 'post_category' === $form_field_type && ! empty( $form_field['displayAllCategories'] ) && empty( $form_field['choices'] ) ) {
1594
-			$filter['choices'] = gravityview_get_terms_choices();
1595
-		} elseif ( ! empty( $form_field['choices'] ) ) {
1596
-			$filter['choices'] = $form_field['choices'];
1593
+		if ( 'post_category' === $form_field_type && ! empty( $form_field[ 'displayAllCategories' ] ) && empty( $form_field[ 'choices' ] ) ) {
1594
+			$filter[ 'choices' ] = gravityview_get_terms_choices();
1595
+		} elseif ( ! empty( $form_field[ 'choices' ] ) ) {
1596
+			$filter[ 'choices' ] = $form_field[ 'choices' ];
1597 1597
 		}
1598 1598
 
1599
-		if ( 'date_range' === $field['input'] && empty( $value ) ) {
1600
-			$filter['value'] = array( 'start' => '', 'end' => '' );
1599
+		if ( 'date_range' === $field[ 'input' ] && empty( $value ) ) {
1600
+			$filter[ 'value' ] = array( 'start' => '', 'end' => '' );
1601 1601
 		}
1602 1602
 
1603
-		if ( 'created_by' === $field['field'] ) {
1604
-			$filter['choices'] = self::get_created_by_choices( $context->view );
1605
-			$filter['type'] = 'created_by';
1603
+		if ( 'created_by' === $field[ 'field' ] ) {
1604
+			$filter[ 'choices' ] = self::get_created_by_choices( $context->view );
1605
+			$filter[ 'type' ] = 'created_by';
1606 1606
 		}
1607 1607
 
1608
-		if ( ! empty( $filter['choices'] ) ) {
1608
+		if ( ! empty( $filter[ 'choices' ] ) ) {
1609 1609
 			/**
1610 1610
 			 * @filter `gravityview/search/sieve_choices` Only output used choices for this field.
1611 1611
 			 * @param[in,out] bool Yes or no.
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
 			 * @param \GV\Context The context.
1614 1614
 			 */
1615 1615
 			if ( apply_filters( 'gravityview/search/sieve_choices', false, $field, $context ) ) {
1616
-				$filter['choices'] = $this->sieve_filter_choices( $filter, $context );
1616
+				$filter[ 'choices' ] = $this->sieve_filter_choices( $filter, $context );
1617 1617
 			}
1618 1618
 		}
1619 1619
 
@@ -1642,12 +1642,12 @@  discard block
 block discarded – undo
1642 1642
 	 * @return array The filter choices.
1643 1643
 	 */
1644 1644
 	private function sieve_filter_choices( $filter, $context ) {
1645
-		if ( empty( $filter['key'] ) || empty( $filter['choices'] ) ) {
1645
+		if ( empty( $filter[ 'key' ] ) || empty( $filter[ 'choices' ] ) ) {
1646 1646
 			return $filter; // @todo Populate plugins might give us empty choices
1647 1647
 		}
1648 1648
 
1649 1649
 		// Allow only created_by and field-ids to be sieved.
1650
-		if ( 'created_by' !== $filter['key'] && ! is_numeric( $filter['key'] ) ) {
1650
+		if ( 'created_by' !== $filter[ 'key' ] && ! is_numeric( $filter[ 'key' ] ) ) {
1651 1651
 			return $filter;
1652 1652
 		}
1653 1653
 
@@ -1658,13 +1658,13 @@  discard block
 block discarded – undo
1658 1658
 		$entry_table_name = GFFormsModel::get_entry_table_name();
1659 1659
 		$entry_meta_table_name = GFFormsModel::get_entry_meta_table_name();
1660 1660
 
1661
-		$key_like = $wpdb->esc_like( $filter['key'] ) . '.%';
1661
+		$key_like = $wpdb->esc_like( $filter[ 'key' ] ) . '.%';
1662 1662
 
1663 1663
 		switch ( \GV\Utils::get( $filter, 'type' ) ):
1664 1664
 			case 'post_category':
1665 1665
 				$choices = $wpdb->get_col( $wpdb->prepare(
1666 1666
 					"SELECT DISTINCT SUBSTRING_INDEX(meta_value, ':', 1) FROM $entry_meta_table_name WHERE (meta_key LIKE %s OR meta_key = %d) AND form_id = %d",
1667
-					$key_like, $filter['key'], $form_id
1667
+					$key_like, $filter[ 'key' ], $form_id
1668 1668
 				) );
1669 1669
 				break;
1670 1670
 			case 'created_by':
@@ -1676,17 +1676,17 @@  discard block
 block discarded – undo
1676 1676
 			default:
1677 1677
 				$choices = $wpdb->get_col( $wpdb->prepare(
1678 1678
 					"SELECT DISTINCT meta_value FROM $entry_meta_table_name WHERE (meta_key LIKE %s OR meta_key = %d) AND form_id = %d",
1679
-					$key_like, $filter['key'], $form_id
1679
+					$key_like, $filter[ 'key' ], $form_id
1680 1680
 				) );
1681 1681
 
1682
-				if ( ( $field = gravityview_get_field( $form_id, $filter['key'] ) ) && 'json' === $field->storageType ) {
1682
+				if ( ( $field = gravityview_get_field( $form_id, $filter[ 'key' ] ) ) && 'json' === $field->storageType ) {
1683 1683
 					$choices = array_map( 'json_decode', $choices );
1684 1684
 					$_choices_array = array();
1685 1685
 					foreach ( $choices as $choice ) {
1686 1686
 						if ( is_array( $choice ) ) {
1687 1687
 							$_choices_array = array_merge( $_choices_array, $choice );
1688 1688
 						} else {
1689
-							$_choices_array []= $choice;
1689
+							$_choices_array [ ] = $choice;
1690 1690
 						}
1691 1691
 					}
1692 1692
 					$choices = array_unique( $_choices_array );
@@ -1696,9 +1696,9 @@  discard block
 block discarded – undo
1696 1696
 		endswitch;
1697 1697
 
1698 1698
 		$filter_choices = array();
1699
-		foreach ( $filter['choices'] as $choice ) {
1700
-			if ( in_array( $choice['text'], $choices, true ) || in_array( $choice['value'], $choices, true ) ) {
1701
-				$filter_choices[] = $choice;
1699
+		foreach ( $filter[ 'choices' ] as $choice ) {
1700
+			if ( in_array( $choice[ 'text' ], $choices, true ) || in_array( $choice[ 'value' ], $choices, true ) ) {
1701
+				$filter_choices[ ] = $choice;
1702 1702
 			}
1703 1703
 		}
1704 1704
 
@@ -1733,7 +1733,7 @@  discard block
 block discarded – undo
1733 1733
 			 * @param \GV\View $view The view.
1734 1734
 			 */
1735 1735
 			$text = apply_filters( 'gravityview/search/created_by/text', $user->display_name, $user, $view );
1736
-			$choices[] = array(
1736
+			$choices[ ] = array(
1737 1737
 				'value' => $user->ID,
1738 1738
 				'text' => $text,
1739 1739
 			);
@@ -1753,9 +1753,9 @@  discard block
 block discarded – undo
1753 1753
 
1754 1754
 		$choices = array();
1755 1755
 		foreach ( GravityView_Entry_Approval_Status::get_all() as $status ) {
1756
-			$choices[] = array(
1757
-				'value' => $status['value'],
1758
-				'text' => $status['label'],
1756
+			$choices[ ] = array(
1757
+				'value' => $status[ 'value' ],
1758
+				'text' => $status[ 'label' ],
1759 1759
 			);
1760 1760
 		}
1761 1761
 
@@ -1807,7 +1807,7 @@  discard block
 block discarded – undo
1807 1807
 	 */
1808 1808
 	public function add_datepicker_js_dependency( $js_dependencies ) {
1809 1809
 
1810
-		$js_dependencies[] = 'jquery-ui-datepicker';
1810
+		$js_dependencies[ ] = 'jquery-ui-datepicker';
1811 1811
 
1812 1812
 		return $js_dependencies;
1813 1813
 	}
@@ -1851,7 +1851,7 @@  discard block
 block discarded – undo
1851 1851
 			'isRTL'             => is_rtl(),
1852 1852
 		), $view_data );
1853 1853
 
1854
-		$localizations['datepicker'] = $datepicker_settings;
1854
+		$localizations[ 'datepicker' ] = $datepicker_settings;
1855 1855
 
1856 1856
 		return $localizations;
1857 1857
 
@@ -1878,7 +1878,7 @@  discard block
 block discarded – undo
1878 1878
 	 * @return void
1879 1879
 	 */
1880 1880
 	private function maybe_enqueue_flexibility() {
1881
-		if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/MSIE [8-9]/', $_SERVER['HTTP_USER_AGENT'] ) ) {
1881
+		if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) && preg_match( '/MSIE [8-9]/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
1882 1882
 			wp_enqueue_script( 'gv-flexibility' );
1883 1883
 		}
1884 1884
 	}
@@ -1900,7 +1900,7 @@  discard block
 block discarded – undo
1900 1900
 		add_filter( 'gravityview_js_localization', array( $this, 'add_datepicker_localization' ), 10, 2 );
1901 1901
 
1902 1902
 		$scheme = is_ssl() ? 'https://' : 'http://';
1903
-		wp_enqueue_style( 'jquery-ui-datepicker', $scheme.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1903
+		wp_enqueue_style( 'jquery-ui-datepicker', $scheme . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1904 1904
 
1905 1905
 		/**
1906 1906
 		 * @filter `gravityview_search_datepicker_class`
@@ -1979,7 +1979,7 @@  discard block
 block discarded – undo
1979 1979
 	public function add_preview_inputs() {
1980 1980
 		global $wp;
1981 1981
 
1982
-		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews') ) {
1982
+		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews' ) ) {
1983 1983
 			return;
1984 1984
 		}
1985 1985
 
@@ -2037,7 +2037,7 @@  discard block
 block discarded – undo
2037 2037
  */
2038 2038
 class GravityView_Widget_Search_Author_GF_Query_Condition extends \GF_Query_Condition {
2039 2039
 	public function __construct( $filter, $view ) {
2040
-		$this->value = $filter['value'];
2040
+		$this->value = $filter[ 'value' ];
2041 2041
 		$this->view = $view;
2042 2042
 	}
2043 2043
 
@@ -2069,11 +2069,11 @@  discard block
 block discarded – undo
2069 2069
 		$conditions = array();
2070 2070
 
2071 2071
 		foreach ( $user_fields as $user_field ) {
2072
-			$conditions[] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) .  '%' );
2072
+			$conditions[ ] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) . '%' );
2073 2073
 		}
2074 2074
 
2075 2075
 		foreach ( $user_meta_fields as $meta_field ) {
2076
-			$conditions[] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) .  '%' );
2076
+			$conditions[ ] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) . '%' );
2077 2077
 		}
2078 2078
 
2079 2079
 		$conditions = '(' . implode( ' OR ', $conditions ) . ')';
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-workflow_final_status.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	function modify_entry_value_workflow_final_status( $output, $entry, $field_settings, $field ) {
43 43
 
44
-		if( ! empty( $output ) ) {
44
+		if ( ! empty( $output ) ) {
45 45
 			$output = gravity_flow()->translate_status_label( $output );
46 46
 		}
47 47
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 		foreach ( $search_fields as & $search_field ) {
66 66
 			if ( $this->name === \GV\Utils::get( $search_field, 'key' ) ) {
67
-				$search_field['choices'] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options();
67
+				$search_field[ 'choices' ] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options();
68 68
 			}
69 69
 		}
70 70
 
Please login to merge, or discard this patch.
future/includes/class-gv-form-gravityforms.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		$self = new self();
56 56
 		$self->form = $form;
57 57
 
58
-		$self->ID = intval( $self->form['id'] );
58
+		$self->ID = intval( $self->form[ 'id' ] );
59 59
 
60 60
 		return $self;
61 61
 	}
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 	 * @return \GV\GF_Form|null An instance of this form or null if not found.
71 71
 	 */
72 72
 	public static function from_form( $form ) {
73
-		if ( empty( $form['id'] ) ) {
73
+		if ( empty( $form[ 'id' ] ) ) {
74 74
 			return null;
75 75
 		}
76 76
 
77 77
 		$self = new self();
78 78
 		$self->form = $form;
79
-		$self->ID = $self->form['id'];
79
+		$self->ID = $self->form[ 'id' ];
80 80
 
81 81
 		return $self;
82 82
 	}
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 
120 120
 			/** The offset and limit */
121 121
 			if ( ! empty( $offset->limit ) ) {
122
-				$paging['page_size'] = $offset->limit;
122
+				$paging[ 'page_size' ] = $offset->limit;
123 123
 			}
124 124
 
125 125
 			if ( ! empty( $offset->offset ) ) {
126
-				$paging['offset'] = $offset->offset;
126
+				$paging[ 'offset' ] = $offset->offset;
127 127
 			}
128 128
 
129 129
 			foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) {
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 	 */
181 181
 	public function get_fields() {
182 182
 		$fields = array();
183
-		foreach ( $this['fields'] as $field ) {
184
-			foreach ( empty( $field['inputs'] ) ? array( $field['id'] ) : wp_list_pluck( $field['inputs'], 'id' ) as $id ) {
183
+		foreach ( $this[ 'fields' ] as $field ) {
184
+			foreach ( empty( $field[ 'inputs' ] ) ? array( $field[ 'id' ] ) : wp_list_pluck( $field[ 'inputs' ], 'id' ) as $id ) {
185 185
 				if ( is_numeric( $id ) ) {
186 186
 					$fields[ $id ] = self::get_field( $this, $id );
187 187
 				} else {
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 * @return bool Whether the offset exists or not.
219 219
 	 */
220 220
 	public function offsetExists( $offset ) {
221
-		return isset( $this->form[$offset] );
221
+		return isset( $this->form[ $offset ] );
222 222
 	}
223 223
 
224 224
 	/**
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	 * @return mixed The value of the requested form data.
234 234
 	 */
235 235
 	public function offsetGet( $offset ) {
236
-		return $this->form[$offset];
236
+		return $this->form[ $offset ];
237 237
 	}
238 238
 
239 239
 	/**
Please login to merge, or discard this patch.
future/includes/class-gv-extension.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -291,7 +291,7 @@
 block discarded – undo
291 291
 	public function settings() {
292 292
 
293 293
 		// If doing ajax, get outta here
294
-		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) )  {
294
+		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) {
295 295
 			return;
296 296
 		}
297 297
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -305,13 +305,13 @@
 block discarded – undo
305 305
 			$this->_remote_update_url,
306 306
 			$this->_path,
307 307
 			array(
308
-            	'version'	=> $this->_version, // current version number
309
-            	'license'	=> \GV\Utils::get( $license, 'license_key', \GV\Utils::get( $license, 'license', null ) ),
310
-	            'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
311
-            	'item_name' => $this->_title,  // name of this plugin
312
-            	'author' 	=> strip_tags( $this->_author )  // author of this plugin
313
-          	)
314
-        );
308
+				'version'	=> $this->_version, // current version number
309
+				'license'	=> \GV\Utils::get( $license, 'license_key', \GV\Utils::get( $license, 'license', null ) ),
310
+				'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
311
+				'item_name' => $this->_title,  // name of this plugin
312
+				'author' 	=> strip_tags( $this->_author )  // author of this plugin
313
+		  	)
314
+		);
315 315
 	}
316 316
 
317 317
 	/**
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
 		$tab = wp_parse_args( $tab_settings, $tab_defaults );
181 181
 
182 182
 		// Force the screen to be GravityView
183
-		$tab['screen'] = 'gravityview';
183
+		$tab[ 'screen' ] = 'gravityview';
184 184
 
185 185
 		if ( class_exists( 'GravityView_Metabox_Tab' ) ) {
186
-			$metabox = new \GravityView_Metabox_Tab( $tab['id'], $tab['title'], $tab['file'], $tab['icon-class'], $tab['callback'], $tab['callback_args'] );
186
+			$metabox = new \GravityView_Metabox_Tab( $tab[ 'id' ], $tab[ 'title' ], $tab[ 'file' ], $tab[ 'icon-class' ], $tab[ 'callback' ], $tab[ 'callback_args' ] );
187 187
 			\GravityView_Metabox_Tabs::add( $metabox );
188 188
 		} else {
189
-			add_meta_box( 'gravityview_' . $tab['id'], $tab['title'], $tab['callback'], $tab['screen'], $tab['context'], $tab['priority'] );
189
+			add_meta_box( 'gravityview_' . $tab[ 'id' ], $tab[ 'title' ], $tab[ 'callback' ], $tab[ 'screen' ], $tab[ 'context' ], $tab[ 'priority' ] );
190 190
 		}
191 191
 	}
192 192
 
@@ -211,14 +211,14 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	protected function is_extension_supported() {
213 213
 
214
-		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool) self::$is_compatible );
214
+		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool)self::$is_compatible );
215 215
 
216 216
 		if ( ! function_exists( 'gravityview' ) ) {
217 217
 			$message = sprintf( __( 'Could not activate the %s Extension; GravityView is not active.', 'gravityview' ), esc_html( $this->_title ) );
218
-		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version , ">=" ) ) {
219
-			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_gravityview_version.'</tt>' );
220
-		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version , ">=" ) ) {
221
-			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_php_version.'</tt>' );
218
+		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version, ">=" ) ) {
219
+			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_gravityview_version . '</tt>' );
220
+		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version, ">=" ) ) {
221
+			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_php_version . '</tt>' );
222 222
 		} else if ( ! empty( $this->_max_gravityview_version ) && false === version_compare( $this->_max_gravityview_version, Plugin::$version, ">" ) ) {
223 223
 			$message = sprintf( __( 'The %s Extension is not compatible with this version of GravityView. Please update the Extension to the latest version.', 'gravityview' ), esc_html( $this->_title ) );
224 224
 		} else {
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
 
259 259
 		$locale = get_locale();
260 260
 
261
-		if ( function_exists('get_user_locale') && is_admin() ) {
261
+		if ( function_exists( 'get_user_locale' ) && is_admin() ) {
262 262
 			$locale = get_user_locale();
263 263
 		}
264 264
 
265 265
 		// Traditional WordPress plugin locale filter
266
-		$locale = apply_filters( 'plugin_locale',  $locale, $this->_text_domain );
266
+		$locale = apply_filters( 'plugin_locale', $locale, $this->_text_domain );
267 267
 
268 268
 		$mofile = sprintf( '%1$s-%2$s.mo', $this->_text_domain, $locale );
269 269
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	public function settings() {
292 292
 
293 293
 		// If doing ajax, get outta here
294
-		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) )  {
294
+		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST( 'action' ) ) ) {
295 295
 			return;
296 296
 		}
297 297
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
             	'version'	=> $this->_version, // current version number
309 309
             	'license'	=> \GV\Utils::get( $license, 'license_key', \GV\Utils::get( $license, 'license', null ) ),
310 310
 	            'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
311
-            	'item_name' => $this->_title,  // name of this plugin
311
+            	'item_name' => $this->_title, // name of this plugin
312 312
             	'author' 	=> strip_tags( $this->_author )  // author of this plugin
313 313
           	)
314 314
         );
@@ -337,16 +337,16 @@  discard block
 block discarded – undo
337 337
 	 */
338 338
 	public static function add_notice( $notice = array() ) {
339 339
 
340
-		if ( is_array( $notice ) && empty( $notice['message'] ) ) {
340
+		if ( is_array( $notice ) && empty( $notice[ 'message' ] ) ) {
341 341
 			gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) );
342 342
 			return;
343 343
 		} else if ( is_string( $notice ) ) {
344 344
 			$notice = array( 'message' => $notice );
345 345
 		}
346 346
 
347
-		$notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class'];
347
+		$notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ];
348 348
 
349
-		self::$admin_notices []= $notice;
349
+		self::$admin_notices [ ] = $notice;
350 350
 	}
351 351
 
352 352
 	/**
@@ -360,8 +360,8 @@  discard block
 block discarded – undo
360 360
 		}
361 361
 
362 362
 		foreach ( self::$admin_notices as $key => $notice ) {
363
-			echo '<div id="message" class="'. esc_attr( $notice['class'] ).'">';
364
-			echo wpautop( $notice['message'] );
363
+			echo '<div id="message" class="' . esc_attr( $notice[ 'class' ] ) . '">';
364
+			echo wpautop( $notice[ 'message' ] );
365 365
 			echo '<div class="clear"></div>';
366 366
 			echo '</div>';
367 367
 		}
Please login to merge, or discard this patch.