Completed
Push — develop ( 14ae0e...1a85cd )
by
unknown
16:51
created
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'], $blacklist_field_types ) ) {
392
+				if ( in_array( $field[ 'type' ], $blacklist_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
 		}
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 			return $search_criteria; // Return the original criteria, GF_Query modification kicks in later
575 575
 		}
576 576
 
577
-		if( 'post' === $this->search_method ) {
577
+		if ( 'post' === $this->search_method ) {
578 578
 			$get = $_POST;
579 579
 		} else {
580 580
 			$get = $_GET;
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 		$get = gv_map_deep( $get, 'rawurldecode' );
594 594
 
595 595
 		// Make sure array key is set up
596
-		$search_criteria['field_filters'] = \GV\Utils::get( $search_criteria, 'field_filters', array() );
596
+		$search_criteria[ 'field_filters' ] = \GV\Utils::get( $search_criteria, 'field_filters', array() );
597 597
 
598 598
 		$searchable_fields = $this->get_view_searchable_fields( $view );
599 599
 		$searchable_field_objects = $this->get_view_searchable_fields( $view, true );
@@ -613,9 +613,9 @@  discard block
 block discarded – undo
613 613
 		$trim_search_value = apply_filters( 'gravityview/search-trim-input', true );
614 614
 
615 615
 		// add free search
616
-		if ( isset( $get['gv_search'] ) && '' !== $get['gv_search'] && in_array( 'search_all', $searchable_fields ) ) {
616
+		if ( isset( $get[ 'gv_search' ] ) && '' !== $get[ 'gv_search' ] && in_array( 'search_all', $searchable_fields ) ) {
617 617
 
618
-			$search_all_value = $trim_search_value ? trim( $get['gv_search'] ) : $get['gv_search'];
618
+			$search_all_value = $trim_search_value ? trim( $get[ 'gv_search' ] ) : $get[ 'gv_search' ];
619 619
 
620 620
 			if ( $split_words ) {
621 621
 				// Search for a piece
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 			}
632 632
 
633 633
 			foreach ( $words as $word ) {
634
-				$search_criteria['field_filters'][] = array(
634
+				$search_criteria[ 'field_filters' ][ ] = array(
635 635
 					'key' => null, // The field ID to search
636 636
 					'value' => $word, // The value to search
637 637
 					'operator' => 'contains', // What to search in. Options: `is` or `contains`
@@ -644,14 +644,14 @@  discard block
 block discarded – undo
644 644
 			/**
645 645
 			 * Get and normalize the dates according to the input format.
646 646
 			 */
647
-			if ( $curr_start = ! empty( $get['gv_start'] ) ? $get['gv_start'] : '' ) {
648
-				if( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) {
647
+			if ( $curr_start = ! empty( $get[ 'gv_start' ] ) ? $get[ 'gv_start' ] : '' ) {
648
+				if ( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) {
649 649
 					$curr_start = $curr_start_date->format( 'Y-m-d' );
650 650
 				}
651 651
 			}
652 652
 
653
-			if ( $curr_end = ! empty( $get['gv_start'] ) ? ( ! empty( $get['gv_end'] ) ? $get['gv_end'] : '' ) : '' ) {
654
-				if( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) {
653
+			if ( $curr_end = ! empty( $get[ 'gv_start' ] ) ? ( ! empty( $get[ 'gv_end' ] ) ? $get[ 'gv_end' ] : '' ) : '' ) {
654
+				if ( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) {
655 655
 					$curr_end = $curr_end_date->format( 'Y-m-d' );
656 656
 				}
657 657
 			}
@@ -687,22 +687,22 @@  discard block
 block discarded – undo
687 687
 			 */
688 688
 			if ( ! empty( $curr_start ) ) {
689 689
 				$curr_start = date( 'Y-m-d H:i:s', strtotime( $curr_start ) );
690
-				$search_criteria['start_date'] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
690
+				$search_criteria[ 'start_date' ] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
691 691
 			}
692 692
 
693 693
 			if ( ! empty( $curr_end ) ) {
694 694
 				// Fast-forward 24 hour on the end time
695 695
 				$curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS );
696
-				$search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
697
-				if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056
698
-					$search_criteria['end_date'] = date( 'Y-m-d H:i:s', strtotime( $search_criteria['end_date'] ) - 1 );
696
+				$search_criteria[ 'end_date' ] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
697
+				if ( strpos( $search_criteria[ 'end_date' ], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056
698
+					$search_criteria[ 'end_date' ] = date( 'Y-m-d H:i:s', strtotime( $search_criteria[ 'end_date' ] ) - 1 );
699 699
 				}
700 700
 			}
701 701
 		}
702 702
 
703 703
 		// search for a specific entry ID
704 704
 		if ( ! empty( $get[ 'gv_id' ] ) && in_array( 'entry_id', $searchable_fields ) ) {
705
-			$search_criteria['field_filters'][] = array(
705
+			$search_criteria[ 'field_filters' ][ ] = array(
706 706
 				'key' => 'id',
707 707
 				'value' => absint( $get[ 'gv_id' ] ),
708 708
 				'operator' => $this->get_operator( $get, 'gv_id', array( '=' ), '=' ),
@@ -711,15 +711,15 @@  discard block
 block discarded – undo
711 711
 
712 712
 		// search for a specific Created_by ID
713 713
 		if ( ! empty( $get[ 'gv_by' ] ) && in_array( 'created_by', $searchable_fields ) ) {
714
-			$search_criteria['field_filters'][] = array(
714
+			$search_criteria[ 'field_filters' ][ ] = array(
715 715
 				'key' => 'created_by',
716
-				'value' => $get['gv_by'],
716
+				'value' => $get[ 'gv_by' ],
717 717
 				'operator' => $this->get_operator( $get, 'gv_by', array( '=' ), '=' ),
718 718
 			);
719 719
 		}
720 720
 
721 721
 		// Get search mode passed in URL
722
-		$mode = isset( $get['mode'] ) && in_array( $get['mode'], array( 'any', 'all' ) ) ?  $get['mode'] : 'any';
722
+		$mode = isset( $get[ 'mode' ] ) && in_array( $get[ 'mode' ], array( 'any', 'all' ) ) ? $get[ 'mode' ] : 'any';
723 723
 
724 724
 		// get the other search filters
725 725
 		foreach ( $get as $key => $value ) {
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 				$value = is_array( $value ) ? array_map( 'trim', $value ) : trim( $value );
732 732
 			}
733 733
 
734
-			if ( gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[0], false, false ) ) ) {
734
+			if ( gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[ 0 ], false, false ) ) ) {
735 735
 				continue;
736 736
 			}
737 737
 
@@ -745,21 +745,21 @@  discard block
 block discarded – undo
745 745
 				continue;
746 746
 			}
747 747
 
748
-			if ( ! isset( $filter['operator'] ) ) {
749
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
748
+			if ( ! isset( $filter[ 'operator' ] ) ) {
749
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
750 750
 			}
751 751
 
752
-			if ( isset( $filter[0]['value'] ) ) {
753
-				$filter[0]['value'] = $trim_search_value ? trim( $filter[0]['value'] ) : $filter[0]['value'];
752
+			if ( isset( $filter[ 0 ][ 'value' ] ) ) {
753
+				$filter[ 0 ][ 'value' ] = $trim_search_value ? trim( $filter[ 0 ][ 'value' ] ) : $filter[ 0 ][ 'value' ];
754 754
 
755
-				$search_criteria['field_filters'] = array_merge( $search_criteria['field_filters'], $filter );
755
+				$search_criteria[ 'field_filters' ] = array_merge( $search_criteria[ 'field_filters' ], $filter );
756 756
 
757 757
 				// if date range type, set search mode to ALL
758
-				if ( ! empty( $filter[0]['operator'] ) && in_array( $filter[0]['operator'], array( '>=', '<=', '>', '<' ) ) ) {
758
+				if ( ! empty( $filter[ 0 ][ 'operator' ] ) && in_array( $filter[ 0 ][ 'operator' ], array( '>=', '<=', '>', '<' ) ) ) {
759 759
 					$mode = 'all';
760 760
 				}
761
-			} elseif( !empty( $filter ) ) {
762
-				$search_criteria['field_filters'][] = $filter;
761
+			} elseif ( ! empty( $filter ) ) {
762
+				$search_criteria[ 'field_filters' ][ ] = $filter;
763 763
 			}
764 764
 		}
765 765
 
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 		 * @since 1.5.1
769 769
 		 * @param[out,in] string $mode Search mode (`any` vs `all`)
770 770
 		 */
771
-		$search_criteria['field_filters']['mode'] = apply_filters( 'gravityview/search/mode', $mode );
771
+		$search_criteria[ 'field_filters' ][ 'mode' ] = apply_filters( 'gravityview/search/mode', $mode );
772 772
 
773 773
 		gravityview()->log->debug( 'Returned Search Criteria: ', array( 'data' => $search_criteria ) );
774 774
 
@@ -802,19 +802,19 @@  discard block
 block discarded – undo
802 802
 
803 803
 		$query_class = $view->get_query_class();
804 804
 
805
-		if ( empty( $search_criteria['field_filters'] ) ) {
805
+		if ( empty( $search_criteria[ 'field_filters' ] ) ) {
806 806
 			return;
807 807
 		}
808 808
 
809 809
 		$widgets = $view->widgets->by_id( $this->widget_id );
810 810
 		if ( $widgets->count() ) {
811 811
 			$widgets = $widgets->all();
812
-			$widget  = $widgets[0];
812
+			$widget  = $widgets[ 0 ];
813 813
 
814 814
 			$search_fields = json_decode( $widget->configuration->get( 'search_fields' ), true );
815 815
 
816
-			foreach ( (array) $search_fields as $search_field ) {
817
-				if ( 'created_by' === $search_field['field'] && 'input_text' === $search_field['input'] ) {
816
+			foreach ( (array)$search_fields as $search_field ) {
817
+				if ( 'created_by' === $search_field[ 'field' ] && 'input_text' === $search_field[ 'input' ] ) {
818 818
 					$created_by_text_mode = true;
819 819
 				}
820 820
 			}
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 		$extra_conditions = array();
824 824
 		$mode = 'any';
825 825
 
826
-		foreach ( $search_criteria['field_filters'] as &$filter ) {
826
+		foreach ( $search_criteria[ 'field_filters' ] as &$filter ) {
827 827
 			if ( ! is_array( $filter ) ) {
828 828
 				if ( in_array( strtolower( $filter ), array( 'any', 'all' ) ) ) {
829 829
 					$mode = $filter;
@@ -832,13 +832,13 @@  discard block
 block discarded – undo
832 832
 			}
833 833
 
834 834
 			// Construct a manual query for unapproved statuses
835
-			if ( 'is_approved' === $filter['key'] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array) $filter['value'] ) ) {
836
-				$_tmp_query       = new $query_class( $view->form->ID, array(
835
+			if ( 'is_approved' === $filter[ 'key' ] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array)$filter[ 'value' ] ) ) {
836
+				$_tmp_query = new $query_class( $view->form->ID, array(
837 837
 					'field_filters' => array(
838 838
 						array(
839 839
 							'operator' => 'in',
840 840
 							'key'      => 'is_approved',
841
-							'value'    => (array) $filter['value'],
841
+							'value'    => (array)$filter[ 'value' ],
842 842
 						),
843 843
 						array(
844 844
 							'operator' => 'is',
@@ -850,30 +850,30 @@  discard block
 block discarded – undo
850 850
 				) );
851 851
 				$_tmp_query_parts = $_tmp_query->_introspect();
852 852
 
853
-				$extra_conditions[] = $_tmp_query_parts['where'];
853
+				$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
854 854
 
855 855
 				$filter = false;
856 856
 				continue;
857 857
 			}
858 858
 
859 859
 			// Construct manual query for text mode creator search
860
-			if ( 'created_by' === $filter['key'] && ! empty( $created_by_text_mode ) ) {
861
-				$extra_conditions[] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
860
+			if ( 'created_by' === $filter[ 'key' ] && ! empty( $created_by_text_mode ) ) {
861
+				$extra_conditions[ ] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
862 862
 				$filter = false;
863 863
 				continue;
864 864
 			}
865 865
 
866 866
 			// By default, we want searches to be wildcard for each field.
867
-			$filter['operator'] = empty( $filter['operator'] ) ? 'contains' : $filter['operator'];
867
+			$filter[ 'operator' ] = empty( $filter[ 'operator' ] ) ? 'contains' : $filter[ 'operator' ];
868 868
 
869 869
 			// For multichoice, let's have an in (OR) search.
870
-			if ( is_array( $filter['value'] ) ) {
871
-				$filter['operator'] = 'in'; // @todo what about in contains (OR LIKE chains)?
870
+			if ( is_array( $filter[ 'value' ] ) ) {
871
+				$filter[ 'operator' ] = 'in'; // @todo what about in contains (OR LIKE chains)?
872 872
 			}
873 873
 
874 874
 			// Default form with joins functionality
875
-			if ( empty( $filter['form_id'] ) ) {
876
-				$filter['form_id'] = $view->form ? $view->form->ID : 0;
875
+			if ( empty( $filter[ 'form_id' ] ) ) {
876
+				$filter[ 'form_id' ] = $view->form ? $view->form->ID : 0;
877 877
 			}
878 878
 
879 879
 			/**
@@ -883,28 +883,28 @@  discard block
 block discarded – undo
883 883
 			 * @param array $filter array with `key`, `value`, `operator`, `type` keys
884 884
 			 * @param \GV\View $view The View we're operating on.
885 885
 			 */
886
-			$filter['operator'] = apply_filters( 'gravityview_search_operator', $filter['operator'], $filter, $view );
886
+			$filter[ 'operator' ] = apply_filters( 'gravityview_search_operator', $filter[ 'operator' ], $filter, $view );
887 887
 		}
888 888
 
889
-		if ( ! empty( $search_criteria['start_date'] ) || ! empty( $search_criteria['end_date'] ) ) {
889
+		if ( ! empty( $search_criteria[ 'start_date' ] ) || ! empty( $search_criteria[ 'end_date' ] ) ) {
890 890
 			$date_criteria = array();
891 891
 
892
-			if ( isset( $search_criteria['start_date'] ) ) {
893
-				$date_criteria['start_date'] = $search_criteria['start_date'];
892
+			if ( isset( $search_criteria[ 'start_date' ] ) ) {
893
+				$date_criteria[ 'start_date' ] = $search_criteria[ 'start_date' ];
894 894
 			}
895 895
 
896
-			if ( isset( $search_criteria['end_date'] ) ) {
897
-				$date_criteria['end_date'] = $search_criteria['end_date'];
896
+			if ( isset( $search_criteria[ 'end_date' ] ) ) {
897
+				$date_criteria[ 'end_date' ] = $search_criteria[ 'end_date' ];
898 898
 			}
899 899
 
900 900
 			$_tmp_query         = new $query_class( $view->form->ID, $date_criteria );
901 901
 			$_tmp_query_parts   = $_tmp_query->_introspect();
902
-			$extra_conditions[] = $_tmp_query_parts['where'];
902
+			$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
903 903
 		}
904 904
 
905 905
 		$search_conditions = array();
906 906
 
907
-		if ( $filters = array_filter( $search_criteria['field_filters'] ) ) {
907
+		if ( $filters = array_filter( $search_criteria[ 'field_filters' ] ) ) {
908 908
 			foreach ( $filters as &$filter ) {
909 909
 				if ( ! is_array( $filter ) ) {
910 910
 					continue;
@@ -916,12 +916,12 @@  discard block
 block discarded – undo
916 916
 				 * code by reusing what's inside GF_Query already as they
917 917
 				 * take care of many small things like forcing numeric, etc.
918 918
 				 */
919
-				$_tmp_query       = new $query_class( $filter['form_id'], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
919
+				$_tmp_query       = new $query_class( $filter[ 'form_id' ], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
920 920
 				$_tmp_query_parts = $_tmp_query->_introspect();
921
-				$search_condition = $_tmp_query_parts['where'];
921
+				$search_condition = $_tmp_query_parts[ 'where' ];
922 922
 
923
-				if ( empty( $filter['key'] ) && $search_condition->expressions ) {
924
-					$search_conditions[] = $search_condition;
923
+				if ( empty( $filter[ 'key' ] ) && $search_condition->expressions ) {
924
+					$search_conditions[ ] = $search_condition;
925 925
 				} else {
926 926
 					$left = $search_condition->left;
927 927
 					$alias = $query->_alias( $left->field_id, $left->source, $left->is_entry_column() ? 't' : 'm' );
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
 							$on = $_join->join_on;
932 932
 							$join = $_join->join;
933 933
 
934
-							$search_conditions[] = GF_Query_Condition::_or(
934
+							$search_conditions[ ] = GF_Query_Condition::_or(
935 935
 								// Join
936 936
 								new GF_Query_Condition(
937 937
 									new GF_Query_Column( GF_Query_Column::META, $join->ID, $query->_alias( GF_Query_Column::META, $join->ID, 'm' ) ),
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
 							);
948 948
 						}
949 949
 					} else {
950
-						$search_conditions[] = new GF_Query_Condition(
950
+						$search_conditions[ ] = new GF_Query_Condition(
951 951
 							new GF_Query_Column( $left->field_id, $left->source, $alias ),
952 952
 							$search_condition->operator,
953 953
 							$search_condition->right
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 		/**
970 970
 		 * Combine the parts as a new WHERE clause.
971 971
 		 */
972
-		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts['where'] ), $search_conditions, $extra_conditions ) );
972
+		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts[ 'where' ] ), $search_conditions, $extra_conditions ) );
973 973
 		$query->where( $where );
974 974
 	}
975 975
 
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 		$field_id = str_replace( 'filter_', '', $key );
993 993
 
994 994
 		// calculates field_id, removing 'filter_' and for '_' for advanced fields ( like name or checkbox )
995
-		if ( preg_match('/^[0-9_]+$/ism', $field_id ) ) {
995
+		if ( preg_match( '/^[0-9_]+$/ism', $field_id ) ) {
996 996
 			$field_id = str_replace( '_', '.', $field_id );
997 997
 		}
998 998
 
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
 			// form is in searchable fields
1050 1050
 			$found = false;
1051 1051
 			foreach ( $searchable_fields as $field ) {
1052
-				if ( $field_id == $field['field'] && $form->ID == $field['form_id'] ) {
1052
+				if ( $field_id == $field[ 'field' ] && $form->ID == $field[ 'form_id' ] ) {
1053 1053
 					$found = true;
1054 1054
 					break;
1055 1055
 				}
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 
1090 1090
 			case 'select':
1091 1091
 			case 'radio':
1092
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1092
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1093 1093
 				break;
1094 1094
 
1095 1095
 			case 'post_category':
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 
1104 1104
 				foreach ( $value as $val ) {
1105 1105
 					$cat = get_term( $val, 'category' );
1106
-					$filter[] = array(
1106
+					$filter[ ] = array(
1107 1107
 						'key'      => $field_id,
1108 1108
 						'value'    => esc_attr( $cat->name ) . ':' . $val,
1109 1109
 						'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
 				$filter = array();
1123 1123
 
1124 1124
 				foreach ( $value as $val ) {
1125
-					$filter[] = array( 'key' => $field_id, 'value' => $val );
1125
+					$filter[ ] = array( 'key' => $field_id, 'value' => $val );
1126 1126
 				}
1127 1127
 
1128 1128
 				break;
@@ -1131,9 +1131,9 @@  discard block
 block discarded – undo
1131 1131
 				// convert checkbox on/off into the correct search filter
1132 1132
 				if ( false !== strpos( $field_id, '.' ) && ! empty( $form_field->inputs ) && ! empty( $form_field->choices ) ) {
1133 1133
 					foreach ( $form_field->inputs as $k => $input ) {
1134
-						if ( $input['id'] == $field_id ) {
1135
-							$filter['value'] = $form_field->choices[ $k ]['value'];
1136
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1134
+						if ( $input[ 'id' ] == $field_id ) {
1135
+							$filter[ 'value' ] = $form_field->choices[ $k ][ 'value' ];
1136
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1137 1137
 							break;
1138 1138
 						}
1139 1139
 					}
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
 					$filter = array();
1144 1144
 
1145 1145
 					foreach ( $value as $val ) {
1146
-						$filter[] = array(
1146
+						$filter[ ] = array(
1147 1147
 							'key'      => $field_id,
1148 1148
 							'value'    => $val,
1149 1149
 							'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1164,9 +1164,9 @@  discard block
 block discarded – undo
1164 1164
 					foreach ( $words as $word ) {
1165 1165
 						if ( ! empty( $word ) && strlen( $word ) > 1 ) {
1166 1166
 							// Keep the same key for each filter
1167
-							$filter['value'] = $word;
1167
+							$filter[ 'value' ] = $word;
1168 1168
 							// Add a search for the value
1169
-							$filters[] = $filter;
1169
+							$filters[ ] = $filter;
1170 1170
 						}
1171 1171
 					}
1172 1172
 
@@ -1180,19 +1180,19 @@  discard block
 block discarded – undo
1180 1180
 
1181 1181
 					foreach ( $searchable_fields as $searchable_field ) {
1182 1182
 
1183
-						if( $form_field->ID !== $searchable_field['field'] ) {
1183
+						if ( $form_field->ID !== $searchable_field[ 'field' ] ) {
1184 1184
 							continue;
1185 1185
 						}
1186 1186
 
1187 1187
 						// Only exact-match dropdowns, not text search
1188
-						if( in_array( $searchable_field['input'], array( 'text', 'search' ), true ) ) {
1188
+						if ( in_array( $searchable_field[ 'input' ], array( 'text', 'search' ), true ) ) {
1189 1189
 							continue;
1190 1190
 						}
1191 1191
 
1192 1192
 						$input_id = gravityview_get_input_id_from_id( $form_field->ID );
1193 1193
 
1194 1194
 						if ( 4 === $input_id ) {
1195
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1195
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1196 1196
 						};
1197 1197
 					}
1198 1198
 				}
@@ -1220,12 +1220,12 @@  discard block
 block discarded – undo
1220 1220
 						 * @since 1.16.3
1221 1221
 						 * Safeguard until GF implements '<=' operator
1222 1222
 						 */
1223
-						if( !GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1223
+						if ( ! GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1224 1224
 							$operator = '<';
1225 1225
 							$date = date( 'Y-m-d', strtotime( self::get_formatted_date( $date, 'Y-m-d', $date_format ) . ' +1 day' ) );
1226 1226
 						}
1227 1227
 
1228
-						$filter[] = array(
1228
+						$filter[ ] = array(
1229 1229
 							'key'      => $field_id,
1230 1230
 							'value'    => self::get_formatted_date( $date, 'Y-m-d', $date_format ),
1231 1231
 							'operator' => $this->get_operator( $get, $key, array( $operator ), $operator ),
@@ -1233,12 +1233,12 @@  discard block
 block discarded – undo
1233 1233
 					}
1234 1234
 				} else {
1235 1235
 					$date = $value;
1236
-					$filter['value'] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1237
-					$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1236
+					$filter[ 'value' ] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1237
+					$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1238 1238
 				}
1239 1239
 
1240
-				if ('payment_date' === $key) {
1241
-					$filter['operator'] = 'contains';
1240
+				if ( 'payment_date' === $key ) {
1241
+					$filter[ 'operator' ] = 'contains';
1242 1242
 				}
1243 1243
 
1244 1244
 				break;
@@ -1267,7 +1267,7 @@  discard block
 block discarded – undo
1267 1267
 			'ymd_dot' => 'Y.m.d',
1268 1268
 		);
1269 1269
 
1270
-		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){
1270
+		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) {
1271 1271
 			$format = $datepicker[ $field->dateFormat ];
1272 1272
 		}
1273 1273
 
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
 	public function add_template_path( $file_paths ) {
1305 1305
 
1306 1306
 		// Index 100 is the default GravityView template path.
1307
-		$file_paths[102] = self::$file . 'templates/';
1307
+		$file_paths[ 102 ] = self::$file . 'templates/';
1308 1308
 
1309 1309
 		return $file_paths;
1310 1310
 	}
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
 		$has_date = false;
1324 1324
 
1325 1325
 		foreach ( $search_fields as $k => $field ) {
1326
-			if ( in_array( $field['input'], array( 'date', 'date_range', 'entry_date' ) ) ) {
1326
+			if ( in_array( $field[ 'input' ], array( 'date', 'date_range', 'entry_date' ) ) ) {
1327 1327
 				$has_date = true;
1328 1328
 				break;
1329 1329
 			}
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
 		$view = \GV\View::by_id( $gravityview_view->view_id );
1353 1353
 
1354 1354
 		// get configured search fields
1355
-		$search_fields = ! empty( $widget_args['search_fields'] ) ? json_decode( $widget_args['search_fields'], true ) : '';
1355
+		$search_fields = ! empty( $widget_args[ 'search_fields' ] ) ? json_decode( $widget_args[ 'search_fields' ], true ) : '';
1356 1356
 
1357 1357
 		if ( empty( $search_fields ) || ! is_array( $search_fields ) ) {
1358 1358
 			gravityview()->log->debug( 'No search fields configured for widget:', array( 'data' => $widget_args ) );
@@ -1366,39 +1366,39 @@  discard block
 block discarded – undo
1366 1366
 
1367 1367
 			$updated_field = $this->get_search_filter_details( $updated_field, $context );
1368 1368
 
1369
-			switch ( $field['field'] ) {
1369
+			switch ( $field[ 'field' ] ) {
1370 1370
 
1371 1371
 				case 'search_all':
1372
-					$updated_field['key'] = 'search_all';
1373
-					$updated_field['input'] = 'search_all';
1374
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_search' );
1372
+					$updated_field[ 'key' ] = 'search_all';
1373
+					$updated_field[ 'input' ] = 'search_all';
1374
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_search' );
1375 1375
 					break;
1376 1376
 
1377 1377
 				case 'entry_date':
1378
-					$updated_field['key'] = 'entry_date';
1379
-					$updated_field['input'] = 'entry_date';
1380
-					$updated_field['value'] = array(
1378
+					$updated_field[ 'key' ] = 'entry_date';
1379
+					$updated_field[ 'input' ] = 'entry_date';
1380
+					$updated_field[ 'value' ] = array(
1381 1381
 						'start' => $this->rgget_or_rgpost( 'gv_start' ),
1382 1382
 						'end' => $this->rgget_or_rgpost( 'gv_end' ),
1383 1383
 					);
1384 1384
 					break;
1385 1385
 
1386 1386
 				case 'entry_id':
1387
-					$updated_field['key'] = 'entry_id';
1388
-					$updated_field['input'] = 'entry_id';
1389
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_id' );
1387
+					$updated_field[ 'key' ] = 'entry_id';
1388
+					$updated_field[ 'input' ] = 'entry_id';
1389
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_id' );
1390 1390
 					break;
1391 1391
 
1392 1392
 				case 'created_by':
1393
-					$updated_field['key'] = 'created_by';
1394
-					$updated_field['name'] = 'gv_by';
1395
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_by' );
1393
+					$updated_field[ 'key' ] = 'created_by';
1394
+					$updated_field[ 'name' ] = 'gv_by';
1395
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_by' );
1396 1396
 					break;
1397 1397
 
1398 1398
 				case 'is_approved':
1399
-					$updated_field['key'] = 'is_approved';
1400
-					$updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_approved' );
1401
-					$updated_field['choices'] = self::get_is_approved_choices();
1399
+					$updated_field[ 'key' ] = 'is_approved';
1400
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'filter_is_approved' );
1401
+					$updated_field[ 'choices' ] = self::get_is_approved_choices();
1402 1402
 					break;
1403 1403
 			}
1404 1404
 
@@ -1419,16 +1419,16 @@  discard block
 block discarded – undo
1419 1419
 
1420 1420
 		$gravityview_view->permalink_fields = $this->add_no_permalink_fields( array(), $this, $widget_args );
1421 1421
 
1422
-		$gravityview_view->search_layout = ! empty( $widget_args['search_layout'] ) ? $widget_args['search_layout'] : 'horizontal';
1422
+		$gravityview_view->search_layout = ! empty( $widget_args[ 'search_layout' ] ) ? $widget_args[ 'search_layout' ] : 'horizontal';
1423 1423
 
1424 1424
 		/** @since 1.14 */
1425
-		$gravityview_view->search_mode = ! empty( $widget_args['search_mode'] ) ? $widget_args['search_mode'] : 'any';
1425
+		$gravityview_view->search_mode = ! empty( $widget_args[ 'search_mode' ] ) ? $widget_args[ 'search_mode' ] : 'any';
1426 1426
 
1427
-		$custom_class = ! empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
1427
+		$custom_class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
1428 1428
 
1429 1429
 		$gravityview_view->search_class = self::get_search_class( $custom_class );
1430 1430
 
1431
-		$gravityview_view->search_clear = ! empty( $widget_args['search_clear'] ) ? $widget_args['search_clear'] : false;
1431
+		$gravityview_view->search_clear = ! empty( $widget_args[ 'search_clear' ] ) ? $widget_args[ 'search_clear' ] : false;
1432 1432
 
1433 1433
 		if ( $this->has_date_field( $search_fields ) ) {
1434 1434
 			// enqueue datepicker stuff only if needed!
@@ -1450,10 +1450,10 @@  discard block
 block discarded – undo
1450 1450
 	public static function get_search_class( $custom_class = '' ) {
1451 1451
 		$gravityview_view = GravityView_View::getInstance();
1452 1452
 
1453
-		$search_class = 'gv-search-'.$gravityview_view->search_layout;
1453
+		$search_class = 'gv-search-' . $gravityview_view->search_layout;
1454 1454
 
1455
-		if ( ! empty( $custom_class )  ) {
1456
-			$search_class .= ' '.$custom_class;
1455
+		if ( ! empty( $custom_class ) ) {
1456
+			$search_class .= ' ' . $custom_class;
1457 1457
 		}
1458 1458
 
1459 1459
 		/**
@@ -1504,9 +1504,9 @@  discard block
 block discarded – undo
1504 1504
 
1505 1505
 		if ( ! $label ) {
1506 1506
 
1507
-			$label = isset( $form_field['label'] ) ? $form_field['label'] : '';
1507
+			$label = isset( $form_field[ 'label' ] ) ? $form_field[ 'label' ] : '';
1508 1508
 
1509
-			switch( $field['field'] ) {
1509
+			switch ( $field[ 'field' ] ) {
1510 1510
 				case 'search_all':
1511 1511
 					$label = __( 'Search Entries:', 'gravityview' );
1512 1512
 					break;
@@ -1518,10 +1518,10 @@  discard block
 block discarded – undo
1518 1518
 					break;
1519 1519
 				default:
1520 1520
 					// If this is a field input, not a field
1521
-					if ( strpos( $field['field'], '.' ) > 0 && ! empty( $form_field['inputs'] ) ) {
1521
+					if ( strpos( $field[ 'field' ], '.' ) > 0 && ! empty( $form_field[ 'inputs' ] ) ) {
1522 1522
 
1523 1523
 						// Get the label for the field in question, which returns an array
1524
-						$items = wp_list_filter( $form_field['inputs'], array( 'id' => $field['field'] ) );
1524
+						$items = wp_list_filter( $form_field[ 'inputs' ], array( 'id' => $field[ 'field' ] ) );
1525 1525
 
1526 1526
 						// Get the item with the `label` key
1527 1527
 						$values = wp_list_pluck( $items, 'label' );
@@ -1562,13 +1562,13 @@  discard block
 block discarded – undo
1562 1562
 		$form = $gravityview_view->getForm();
1563 1563
 
1564 1564
 		// for advanced field ids (eg, first name / last name )
1565
-		$name = 'filter_' . str_replace( '.', '_', $field['field'] );
1565
+		$name = 'filter_' . str_replace( '.', '_', $field[ 'field' ] );
1566 1566
 
1567 1567
 		// get searched value from $_GET/$_POST (string or array)
1568 1568
 		$value = $this->rgget_or_rgpost( $name );
1569 1569
 
1570 1570
 		// get form field details
1571
-		$form_field = gravityview_get_field( $form, $field['field'] );
1571
+		$form_field = gravityview_get_field( $form, $field[ 'field' ] );
1572 1572
 
1573 1573
 		$form_field_type = \GV\Utils::get( $form_field, 'type' );
1574 1574
 
@@ -1582,22 +1582,22 @@  discard block
 block discarded – undo
1582 1582
 		);
1583 1583
 
1584 1584
 		// collect choices
1585
-		if ( 'post_category' === $form_field_type && ! empty( $form_field['displayAllCategories'] ) && empty( $form_field['choices'] ) ) {
1586
-			$filter['choices'] = gravityview_get_terms_choices();
1587
-		} elseif ( ! empty( $form_field['choices'] ) ) {
1588
-			$filter['choices'] = $form_field['choices'];
1585
+		if ( 'post_category' === $form_field_type && ! empty( $form_field[ 'displayAllCategories' ] ) && empty( $form_field[ 'choices' ] ) ) {
1586
+			$filter[ 'choices' ] = gravityview_get_terms_choices();
1587
+		} elseif ( ! empty( $form_field[ 'choices' ] ) ) {
1588
+			$filter[ 'choices' ] = $form_field[ 'choices' ];
1589 1589
 		}
1590 1590
 
1591
-		if ( 'date_range' === $field['input'] && empty( $value ) ) {
1592
-			$filter['value'] = array( 'start' => '', 'end' => '' );
1591
+		if ( 'date_range' === $field[ 'input' ] && empty( $value ) ) {
1592
+			$filter[ 'value' ] = array( 'start' => '', 'end' => '' );
1593 1593
 		}
1594 1594
 
1595
-		if ( 'created_by' === $field['field'] ) {
1596
-			$filter['choices'] = self::get_created_by_choices( $context->view );
1597
-			$filter['type'] = 'created_by';
1595
+		if ( 'created_by' === $field[ 'field' ] ) {
1596
+			$filter[ 'choices' ] = self::get_created_by_choices( $context->view );
1597
+			$filter[ 'type' ] = 'created_by';
1598 1598
 		}
1599 1599
 
1600
-		if ( ! empty( $filter['choices'] ) ) {
1600
+		if ( ! empty( $filter[ 'choices' ] ) ) {
1601 1601
 			/**
1602 1602
 			 * @filter `gravityview/search/sieve_choices` Only output used choices for this field.
1603 1603
 			 * @param[in,out] bool Yes or no.
@@ -1605,7 +1605,7 @@  discard block
 block discarded – undo
1605 1605
 			 * @param \GV\Context The context.
1606 1606
 			 */
1607 1607
 			if ( apply_filters( 'gravityview/search/sieve_choices', false, $field, $context ) ) {
1608
-				$filter['choices'] = $this->sieve_filter_choices( $filter, $context );
1608
+				$filter[ 'choices' ] = $this->sieve_filter_choices( $filter, $context );
1609 1609
 			}
1610 1610
 		}
1611 1611
 
@@ -1634,12 +1634,12 @@  discard block
 block discarded – undo
1634 1634
 	 * @return array The filter choices.
1635 1635
 	 */
1636 1636
 	private function sieve_filter_choices( $filter, $context ) {
1637
-		if ( empty( $filter['key'] ) || empty( $filter['choices'] ) ) {
1637
+		if ( empty( $filter[ 'key' ] ) || empty( $filter[ 'choices' ] ) ) {
1638 1638
 			return $filter; // @todo Populate plugins might give us empty choices
1639 1639
 		}
1640 1640
 
1641 1641
 		// Allow only created_by and field-ids to be sieved.
1642
-		if ( 'created_by' !== $filter['key'] && ! is_numeric( $filter['key'] ) ) {
1642
+		if ( 'created_by' !== $filter[ 'key' ] && ! is_numeric( $filter[ 'key' ] ) ) {
1643 1643
 			return $filter;
1644 1644
 		}
1645 1645
 
@@ -1650,13 +1650,13 @@  discard block
 block discarded – undo
1650 1650
 		$entry_table_name = GFFormsModel::get_entry_table_name();
1651 1651
 		$entry_meta_table_name = GFFormsModel::get_entry_meta_table_name();
1652 1652
 
1653
-		$key_like = $wpdb->esc_like( $filter['key'] ) . '.%';
1653
+		$key_like = $wpdb->esc_like( $filter[ 'key' ] ) . '.%';
1654 1654
 
1655 1655
 		switch ( \GV\Utils::get( $filter, 'type' ) ):
1656 1656
 			case 'post_category':
1657 1657
 				$choices = $wpdb->get_col( $wpdb->prepare(
1658 1658
 					"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",
1659
-					$key_like, $filter['key'], $form_id
1659
+					$key_like, $filter[ 'key' ], $form_id
1660 1660
 				) );
1661 1661
 				break;
1662 1662
 			case 'created_by':
@@ -1668,17 +1668,17 @@  discard block
 block discarded – undo
1668 1668
 			default:
1669 1669
 				$choices = $wpdb->get_col( $wpdb->prepare(
1670 1670
 					"SELECT DISTINCT meta_value FROM $entry_meta_table_name WHERE (meta_key LIKE %s OR meta_key = %d) AND form_id = %d",
1671
-					$key_like, $filter['key'], $form_id
1671
+					$key_like, $filter[ 'key' ], $form_id
1672 1672
 				) );
1673 1673
 
1674
-				if ( ( $field = gravityview_get_field( $form_id, $filter['key'] ) ) && 'json' === $field->storageType ) {
1674
+				if ( ( $field = gravityview_get_field( $form_id, $filter[ 'key' ] ) ) && 'json' === $field->storageType ) {
1675 1675
 					$choices = array_map( 'json_decode', $choices );
1676 1676
 					$_choices_array = array();
1677 1677
 					foreach ( $choices as $choice ) {
1678 1678
 						if ( is_array( $choice ) ) {
1679 1679
 							$_choices_array = array_merge( $_choices_array, $choice );
1680 1680
 						} else {
1681
-							$_choices_array []= $choice;
1681
+							$_choices_array [ ] = $choice;
1682 1682
 						}
1683 1683
 					}
1684 1684
 					$choices = array_unique( $_choices_array );
@@ -1688,9 +1688,9 @@  discard block
 block discarded – undo
1688 1688
 		endswitch;
1689 1689
 
1690 1690
 		$filter_choices = array();
1691
-		foreach ( $filter['choices'] as $choice ) {
1692
-			if ( in_array( $choice['text'], $choices, true ) || in_array( $choice['value'], $choices, true ) ) {
1693
-				$filter_choices[] = $choice;
1691
+		foreach ( $filter[ 'choices' ] as $choice ) {
1692
+			if ( in_array( $choice[ 'text' ], $choices, true ) || in_array( $choice[ 'value' ], $choices, true ) ) {
1693
+				$filter_choices[ ] = $choice;
1694 1694
 			}
1695 1695
 		}
1696 1696
 
@@ -1725,7 +1725,7 @@  discard block
 block discarded – undo
1725 1725
 			 * @param \GV\View $view The view.
1726 1726
 			 */
1727 1727
 			$text = apply_filters( 'gravityview/search/created_by/text', $user->display_name, $user, $view );
1728
-			$choices[] = array(
1728
+			$choices[ ] = array(
1729 1729
 				'value' => $user->ID,
1730 1730
 				'text' => $text,
1731 1731
 			);
@@ -1745,9 +1745,9 @@  discard block
 block discarded – undo
1745 1745
 
1746 1746
 		$choices = array();
1747 1747
 		foreach ( GravityView_Entry_Approval_Status::get_all() as $status ) {
1748
-			$choices[] = array(
1749
-				'value' => $status['value'],
1750
-				'text' => $status['label'],
1748
+			$choices[ ] = array(
1749
+				'value' => $status[ 'value' ],
1750
+				'text' => $status[ 'label' ],
1751 1751
 			);
1752 1752
 		}
1753 1753
 
@@ -1799,7 +1799,7 @@  discard block
 block discarded – undo
1799 1799
 	 */
1800 1800
 	public function add_datepicker_js_dependency( $js_dependencies ) {
1801 1801
 
1802
-		$js_dependencies[] = 'jquery-ui-datepicker';
1802
+		$js_dependencies[ ] = 'jquery-ui-datepicker';
1803 1803
 
1804 1804
 		return $js_dependencies;
1805 1805
 	}
@@ -1843,7 +1843,7 @@  discard block
 block discarded – undo
1843 1843
 			'isRTL'             => is_rtl(),
1844 1844
 		), $view_data );
1845 1845
 
1846
-		$localizations['datepicker'] = $datepicker_settings;
1846
+		$localizations[ 'datepicker' ] = $datepicker_settings;
1847 1847
 
1848 1848
 		return $localizations;
1849 1849
 
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
 	 * @return void
1871 1871
 	 */
1872 1872
 	private function maybe_enqueue_flexibility() {
1873
-		if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/MSIE [8-9]/', $_SERVER['HTTP_USER_AGENT'] ) ) {
1873
+		if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) && preg_match( '/MSIE [8-9]/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
1874 1874
 			wp_enqueue_script( 'gv-flexibility' );
1875 1875
 		}
1876 1876
 	}
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
 		add_filter( 'gravityview_js_localization', array( $this, 'add_datepicker_localization' ), 10, 2 );
1893 1893
 
1894 1894
 		$scheme = is_ssl() ? 'https://' : 'http://';
1895
-		wp_enqueue_style( 'jquery-ui-datepicker', $scheme.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1895
+		wp_enqueue_style( 'jquery-ui-datepicker', $scheme . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1896 1896
 
1897 1897
 		/**
1898 1898
 		 * @filter `gravityview_search_datepicker_class`
@@ -1971,7 +1971,7 @@  discard block
 block discarded – undo
1971 1971
 	public function add_preview_inputs() {
1972 1972
 		global $wp;
1973 1973
 
1974
-		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews') ) {
1974
+		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews' ) ) {
1975 1975
 			return;
1976 1976
 		}
1977 1977
 
@@ -2023,7 +2023,7 @@  discard block
 block discarded – undo
2023 2023
  */
2024 2024
 class GravityView_Widget_Search_Author_GF_Query_Condition extends \GF_Query_Condition {
2025 2025
 	public function __construct( $filter, $view ) {
2026
-		$this->value = $filter['value'];
2026
+		$this->value = $filter[ 'value' ];
2027 2027
 		$this->view = $view;
2028 2028
 	}
2029 2029
 
@@ -2055,11 +2055,11 @@  discard block
 block discarded – undo
2055 2055
 		$conditions = array();
2056 2056
 
2057 2057
 		foreach ( $user_fields as $user_field ) {
2058
-			$conditions[] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) .  '%' );
2058
+			$conditions[ ] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) . '%' );
2059 2059
 		}
2060 2060
 
2061 2061
 		foreach ( $user_meta_fields as $meta_field ) {
2062
-			$conditions[] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) .  '%' );
2062
+			$conditions[ ] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) . '%' );
2063 2063
 		}
2064 2064
 
2065 2065
 		$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.
includes/widgets/search-widget/templates/search-field-search_all.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 
13 13
 $html_input_type = RGFormsModel::is_html5_enabled() ? 'search' : 'text';
14 14
 ?>
15 15
 
16 16
 <div class="gv-search-box gv-search-field-text gv-search-field-search_all">
17 17
 	<div class="gv-search">
18
-	<?php if( ! gv_empty( $label, false, false ) ) { ?>
18
+	<?php if ( ! gv_empty( $label, false, false ) ) { ?>
19 19
 		<label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
20 20
 	<?php } ?>
21 21
 		<p><input type="<?php echo $html_input_type; ?>" name="gv_search" id="gv_search_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-entry_id.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 ?>
13 13
 
14 14
 <div class="gv-search-box gv-search-field-entry_id">
15 15
 	<div class="gv-search">
16
-		<?php if( ! gv_empty( $label, false, false ) ) { ?>
16
+		<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17 17
 		<label for="gv_entry_id_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 		<?php } ?>
19 19
 		<p><input type="text" name="gv_id" id="gv_entry_id_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-entry_date.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 
13 13
 ?>
14 14
 
15 15
 <div class="gv-search-box gv-search-date gv-search-date-range gv-search-field-entry_date">
16
-	<?php if( ! gv_empty( $label, false, false ) ) { ?>
16
+	<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17 17
 	<label for="gv_start_date_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 	<?php } ?>
19 19
 	<p>
20
-		<input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo $value['start']; ?>">
21
-		<input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo $value['end']; ?>">
20
+		<input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo $value[ 'start' ]; ?>">
21
+		<input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo $value[ 'end' ]; ?>">
22 22
 	</p>
23 23
 </div>
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-date_range.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
12
-$name = $gravityview_view->search_field['name'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12
+$name = $gravityview_view->search_field[ 'name' ];
13 13
 ?>
14 14
 
15 15
 <div class="gv-search-box gv-search-date gv-search-date-range">
16
-	<?php if( ! gv_empty( $label, false, false ) ) { ?>
17
-	<label for="search-box-<?php echo esc_attr( $name ).'-start'; ?>"><?php echo esc_html( $label ); ?></label>
16
+	<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17
+	<label for="search-box-<?php echo esc_attr( $name ) . '-start'; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 	<?php } ?>
19 19
 	<p>
20
-		<input name="<?php echo esc_attr( $name ).'[start]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value['start'] ); ?>">
21
-		<input name="<?php echo esc_attr( $name ).'[end]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value['end'] ); ?>">
20
+		<input name="<?php echo esc_attr( $name ) . '[start]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value[ 'start' ] ); ?>">
21
+		<input name="<?php echo esc_attr( $name ) . '[end]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value[ 'end' ] ); ?>">
22 22
 	</p>
23 23
 </div>
24 24
\ No newline at end of file
Please login to merge, or discard this patch.