Completed
Push — develop ( e19ce2...317109 )
by Zack
32:08 queued 12:09
created
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   +192 added lines, -192 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', 'gk-gravityview' ),
58
-				'desc'  => __( 'When a search is performed, display a button that removes all search values.', 'gk-gravityview'),
58
+				'desc'  => __( 'When a search is performed, display a button that removes all search values.', 'gk-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', 'gk-gravityview' ),
71
-				'desc' => __('Should search results match all search fields, or any?', 'gk-gravityview'),
71
+				'desc' => __( 'Should search results match all search fields, or any?', 'gk-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', 'gk-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;
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 		}
606 606
 
607 607
 		// Make sure array key is set up
608
-		$search_criteria['field_filters'] = \GV\Utils::get( $search_criteria, 'field_filters', array() );
608
+		$search_criteria[ 'field_filters' ] = \GV\Utils::get( $search_criteria, 'field_filters', array() );
609 609
 
610 610
 		$searchable_fields = $this->get_view_searchable_fields( $view );
611 611
 		$searchable_field_objects = $this->get_view_searchable_fields( $view, true );
@@ -625,9 +625,9 @@  discard block
 block discarded – undo
625 625
 		$trim_search_value = apply_filters( 'gravityview/search-trim-input', true );
626 626
 
627 627
 		// add free search
628
-		if ( isset( $get['gv_search'] ) && '' !== $get['gv_search'] && in_array( 'search_all', $searchable_fields ) ) {
628
+		if ( isset( $get[ 'gv_search' ] ) && '' !== $get[ 'gv_search' ] && in_array( 'search_all', $searchable_fields ) ) {
629 629
 
630
-			$search_all_value = $trim_search_value ? trim( $get['gv_search'] ) : $get['gv_search'];
630
+			$search_all_value = $trim_search_value ? trim( $get[ 'gv_search' ] ) : $get[ 'gv_search' ];
631 631
 
632 632
 			if ( $split_words ) {
633 633
 				// Search for a piece
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 			}
644 644
 
645 645
 			foreach ( $words as $word ) {
646
-				$search_criteria['field_filters'][] = array(
646
+				$search_criteria[ 'field_filters' ][ ] = array(
647 647
 					'key' => null, // The field ID to search
648 648
 					'value' => $word, // The value to search
649 649
 					'operator' => 'contains', // What to search in. Options: `is` or `contains`
@@ -656,14 +656,14 @@  discard block
 block discarded – undo
656 656
 			/**
657 657
 			 * Get and normalize the dates according to the input format.
658 658
 			 */
659
-			if ( $curr_start = ! empty( $get['gv_start'] ) ? $get['gv_start'] : '' ) {
660
-				if( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) {
659
+			if ( $curr_start = ! empty( $get[ 'gv_start' ] ) ? $get[ 'gv_start' ] : '' ) {
660
+				if ( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) {
661 661
 					$curr_start = $curr_start_date->format( 'Y-m-d' );
662 662
 				}
663 663
 			}
664 664
 
665
-			if ( $curr_end = ! empty( $get['gv_start'] ) ? ( ! empty( $get['gv_end'] ) ? $get['gv_end'] : '' ) : '' ) {
666
-				if( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) {
665
+			if ( $curr_end = ! empty( $get[ 'gv_start' ] ) ? ( ! empty( $get[ 'gv_end' ] ) ? $get[ 'gv_end' ] : '' ) : '' ) {
666
+				if ( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) {
667 667
 					$curr_end = $curr_end_date->format( 'Y-m-d' );
668 668
 				}
669 669
 			}
@@ -699,22 +699,22 @@  discard block
 block discarded – undo
699 699
 			 */
700 700
 			if ( ! empty( $curr_start ) ) {
701 701
 				$curr_start = date( 'Y-m-d H:i:s', strtotime( $curr_start ) );
702
-				$search_criteria['start_date'] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
702
+				$search_criteria[ 'start_date' ] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
703 703
 			}
704 704
 
705 705
 			if ( ! empty( $curr_end ) ) {
706 706
 				// Fast-forward 24 hour on the end time
707 707
 				$curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS );
708
-				$search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
709
-				if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056
710
-					$search_criteria['end_date'] = date( 'Y-m-d H:i:s', strtotime( $search_criteria['end_date'] ) - 1 );
708
+				$search_criteria[ 'end_date' ] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
709
+				if ( strpos( $search_criteria[ 'end_date' ], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056
710
+					$search_criteria[ 'end_date' ] = date( 'Y-m-d H:i:s', strtotime( $search_criteria[ 'end_date' ] ) - 1 );
711 711
 				}
712 712
 			}
713 713
 		}
714 714
 
715 715
 		// search for a specific entry ID
716 716
 		if ( ! empty( $get[ 'gv_id' ] ) && in_array( 'entry_id', $searchable_fields ) ) {
717
-			$search_criteria['field_filters'][] = array(
717
+			$search_criteria[ 'field_filters' ][ ] = array(
718 718
 				'key' => 'id',
719 719
 				'value' => absint( $get[ 'gv_id' ] ),
720 720
 				'operator' => $this->get_operator( $get, 'gv_id', array( '=' ), '=' ),
@@ -723,15 +723,15 @@  discard block
 block discarded – undo
723 723
 
724 724
 		// search for a specific Created_by ID
725 725
 		if ( ! empty( $get[ 'gv_by' ] ) && in_array( 'created_by', $searchable_fields ) ) {
726
-			$search_criteria['field_filters'][] = array(
726
+			$search_criteria[ 'field_filters' ][ ] = array(
727 727
 				'key' => 'created_by',
728
-				'value' => $get['gv_by'],
728
+				'value' => $get[ 'gv_by' ],
729 729
 				'operator' => $this->get_operator( $get, 'gv_by', array( '=' ), '=' ),
730 730
 			);
731 731
 		}
732 732
 
733 733
 		// Get search mode passed in URL
734
-		$mode = isset( $get['mode'] ) && in_array( $get['mode'], array( 'any', 'all' ) ) ?  $get['mode'] : 'any';
734
+		$mode = isset( $get[ 'mode' ] ) && in_array( $get[ 'mode' ], array( 'any', 'all' ) ) ? $get[ 'mode' ] : 'any';
735 735
 
736 736
 		// get the other search filters
737 737
 		foreach ( $get as $key => $value ) {
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 				$value = is_array( $value ) ? array_map( 'trim', $value ) : trim( $value );
750 750
 			}
751 751
 
752
-			if ( gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[0], false, false ) ) ) {
752
+			if ( gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[ 0 ], false, false ) ) ) {
753 753
 				/**
754 754
 				 * @filter `gravityview/search/ignore-empty-values` Filter to control if empty field values should be ignored or strictly matched (default: true)
755 755
 				 * @since  2.14.2.1
@@ -780,21 +780,21 @@  discard block
 block discarded – undo
780 780
 				continue;
781 781
 			}
782 782
 
783
-			if ( ! isset( $filter['operator'] ) ) {
784
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
783
+			if ( ! isset( $filter[ 'operator' ] ) ) {
784
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
785 785
 			}
786 786
 
787
-			if ( isset( $filter[0]['value'] ) ) {
788
-				$filter[0]['value'] = $trim_search_value ? trim( $filter[0]['value'] ) : $filter[0]['value'];
787
+			if ( isset( $filter[ 0 ][ 'value' ] ) ) {
788
+				$filter[ 0 ][ 'value' ] = $trim_search_value ? trim( $filter[ 0 ][ 'value' ] ) : $filter[ 0 ][ 'value' ];
789 789
 
790
-				$search_criteria['field_filters'] = array_merge( $search_criteria['field_filters'], $filter );
790
+				$search_criteria[ 'field_filters' ] = array_merge( $search_criteria[ 'field_filters' ], $filter );
791 791
 
792 792
 				// if date range type, set search mode to ALL
793
-				if ( ! empty( $filter[0]['operator'] ) && in_array( $filter[0]['operator'], array( '>=', '<=', '>', '<' ) ) ) {
793
+				if ( ! empty( $filter[ 0 ][ 'operator' ] ) && in_array( $filter[ 0 ][ 'operator' ], array( '>=', '<=', '>', '<' ) ) ) {
794 794
 					$mode = 'all';
795 795
 				}
796
-			} elseif( !empty( $filter ) ) {
797
-				$search_criteria['field_filters'][] = $filter;
796
+			} elseif ( ! empty( $filter ) ) {
797
+				$search_criteria[ 'field_filters' ][ ] = $filter;
798 798
 			}
799 799
 		}
800 800
 
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 		 * @since 1.5.1
804 804
 		 * @param string $mode Search mode (`any` vs `all`)
805 805
 		 */
806
-		$search_criteria['field_filters']['mode'] = apply_filters( 'gravityview/search/mode', $mode );
806
+		$search_criteria[ 'field_filters' ][ 'mode' ] = apply_filters( 'gravityview/search/mode', $mode );
807 807
 
808 808
 		gravityview()->log->debug( 'Returned Search Criteria: ', array( 'data' => $search_criteria ) );
809 809
 
@@ -837,19 +837,19 @@  discard block
 block discarded – undo
837 837
 
838 838
 		$query_class = $view->get_query_class();
839 839
 
840
-		if ( empty( $search_criteria['field_filters'] ) ) {
840
+		if ( empty( $search_criteria[ 'field_filters' ] ) ) {
841 841
 			return;
842 842
 		}
843 843
 
844 844
 		$widgets = $view->widgets->by_id( $this->widget_id );
845 845
 		if ( $widgets->count() ) {
846 846
 			$widgets = $widgets->all();
847
-			$widget  = $widgets[0];
847
+			$widget  = $widgets[ 0 ];
848 848
 
849 849
 			$search_fields = json_decode( $widget->configuration->get( 'search_fields' ), true );
850 850
 
851
-			foreach ( (array) $search_fields as $search_field ) {
852
-				if ( 'created_by' === $search_field['field'] && 'input_text' === $search_field['input'] ) {
851
+			foreach ( (array)$search_fields as $search_field ) {
852
+				if ( 'created_by' === $search_field[ 'field' ] && 'input_text' === $search_field[ 'input' ] ) {
853 853
 					$created_by_text_mode = true;
854 854
 				}
855 855
 			}
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
 		$extra_conditions = array();
859 859
 		$mode = 'any';
860 860
 
861
-		foreach ( $search_criteria['field_filters'] as $key => &$filter ) {
861
+		foreach ( $search_criteria[ 'field_filters' ] as $key => &$filter ) {
862 862
 			if ( ! is_array( $filter ) ) {
863 863
 				if ( in_array( strtolower( $filter ), array( 'any', 'all' ) ) ) {
864 864
 					$mode = $filter;
@@ -867,13 +867,13 @@  discard block
 block discarded – undo
867 867
 			}
868 868
 
869 869
 			// Construct a manual query for unapproved statuses
870
-			if ( 'is_approved' === $filter['key'] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array) $filter['value'] ) ) {
871
-				$_tmp_query       = new $query_class( $view->form->ID, array(
870
+			if ( 'is_approved' === $filter[ 'key' ] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array)$filter[ 'value' ] ) ) {
871
+				$_tmp_query = new $query_class( $view->form->ID, array(
872 872
 					'field_filters' => array(
873 873
 						array(
874 874
 							'operator' => 'in',
875 875
 							'key'      => 'is_approved',
876
-							'value'    => (array) $filter['value'],
876
+							'value'    => (array)$filter[ 'value' ],
877 877
 						),
878 878
 						array(
879 879
 							'operator' => 'is',
@@ -885,30 +885,30 @@  discard block
 block discarded – undo
885 885
 				) );
886 886
 				$_tmp_query_parts = $_tmp_query->_introspect();
887 887
 
888
-				$extra_conditions[] = $_tmp_query_parts['where'];
888
+				$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
889 889
 
890 890
 				$filter = false;
891 891
 				continue;
892 892
 			}
893 893
 
894 894
 			// Construct manual query for text mode creator search
895
-			if ( 'created_by' === $filter['key'] && ! empty( $created_by_text_mode ) ) {
896
-				$extra_conditions[] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
895
+			if ( 'created_by' === $filter[ 'key' ] && ! empty( $created_by_text_mode ) ) {
896
+				$extra_conditions[ ] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
897 897
 				$filter = false;
898 898
 				continue;
899 899
 			}
900 900
 
901 901
 			// By default, we want searches to be wildcard for each field.
902
-			$filter['operator'] = empty( $filter['operator'] ) ? 'contains' : $filter['operator'];
902
+			$filter[ 'operator' ] = empty( $filter[ 'operator' ] ) ? 'contains' : $filter[ 'operator' ];
903 903
 
904 904
 			// For multichoice, let's have an in (OR) search.
905
-			if ( is_array( $filter['value'] ) ) {
906
-				$filter['operator'] = 'in'; // @todo what about in contains (OR LIKE chains)?
905
+			if ( is_array( $filter[ 'value' ] ) ) {
906
+				$filter[ 'operator' ] = 'in'; // @todo what about in contains (OR LIKE chains)?
907 907
 			}
908 908
 
909 909
 			// Default form with joins functionality
910
-			if ( empty( $filter['form_id'] ) ) {
911
-				$filter['form_id'] = $view->form ? $view->form->ID : 0;
910
+			if ( empty( $filter[ 'form_id' ] ) ) {
911
+				$filter[ 'form_id' ] = $view->form ? $view->form->ID : 0;
912 912
 			}
913 913
 
914 914
 			/**
@@ -918,32 +918,32 @@  discard block
 block discarded – undo
918 918
 			 * @param array $filter array with `key`, `value`, `operator`, `type` keys
919 919
 			 * @param \GV\View $view The View we're operating on.
920 920
 			 */
921
-			$filter['operator'] = apply_filters( 'gravityview_search_operator', $filter['operator'], $filter, $view );
921
+			$filter[ 'operator' ] = apply_filters( 'gravityview_search_operator', $filter[ 'operator' ], $filter, $view );
922 922
 
923
-			if ( 'is' !== $filter['operator'] && '' === $filter['value'] ) {
924
-				unset( $search_criteria['field_filters'][ $key ] );
923
+			if ( 'is' !== $filter[ 'operator' ] && '' === $filter[ 'value' ] ) {
924
+				unset( $search_criteria[ 'field_filters' ][ $key ] );
925 925
 			}
926 926
 		}
927 927
 
928
-		if ( ! empty( $search_criteria['start_date'] ) || ! empty( $search_criteria['end_date'] ) ) {
928
+		if ( ! empty( $search_criteria[ 'start_date' ] ) || ! empty( $search_criteria[ 'end_date' ] ) ) {
929 929
 			$date_criteria = array();
930 930
 
931
-			if ( isset( $search_criteria['start_date'] ) ) {
932
-				$date_criteria['start_date'] = $search_criteria['start_date'];
931
+			if ( isset( $search_criteria[ 'start_date' ] ) ) {
932
+				$date_criteria[ 'start_date' ] = $search_criteria[ 'start_date' ];
933 933
 			}
934 934
 
935
-			if ( isset( $search_criteria['end_date'] ) ) {
936
-				$date_criteria['end_date'] = $search_criteria['end_date'];
935
+			if ( isset( $search_criteria[ 'end_date' ] ) ) {
936
+				$date_criteria[ 'end_date' ] = $search_criteria[ 'end_date' ];
937 937
 			}
938 938
 
939 939
 			$_tmp_query         = new $query_class( $view->form->ID, $date_criteria );
940 940
 			$_tmp_query_parts   = $_tmp_query->_introspect();
941
-			$extra_conditions[] = $_tmp_query_parts['where'];
941
+			$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
942 942
 		}
943 943
 
944 944
 		$search_conditions = array();
945 945
 
946
-		if ( $filters = array_filter( $search_criteria['field_filters'] ) ) {
946
+		if ( $filters = array_filter( $search_criteria[ 'field_filters' ] ) ) {
947 947
 			foreach ( $filters as &$filter ) {
948 948
 				if ( ! is_array( $filter ) ) {
949 949
 					continue;
@@ -955,12 +955,12 @@  discard block
 block discarded – undo
955 955
 				 * code by reusing what's inside GF_Query already as they
956 956
 				 * take care of many small things like forcing numeric, etc.
957 957
 				 */
958
-				$_tmp_query       = new $query_class( $filter['form_id'], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
958
+				$_tmp_query       = new $query_class( $filter[ 'form_id' ], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
959 959
 				$_tmp_query_parts = $_tmp_query->_introspect();
960
-				$search_condition = $_tmp_query_parts['where'];
960
+				$search_condition = $_tmp_query_parts[ 'where' ];
961 961
 
962
-				if ( empty( $filter['key'] ) && $search_condition->expressions ) {
963
-					$search_conditions[] = $search_condition;
962
+				if ( empty( $filter[ 'key' ] ) && $search_condition->expressions ) {
963
+					$search_conditions[ ] = $search_condition;
964 964
 				} else {
965 965
 					$left = $search_condition->left;
966 966
 
@@ -972,8 +972,8 @@  discard block
 block discarded – undo
972 972
 
973 973
 							$value = $reflectionProperty->getValue( $left );
974 974
 
975
-							if ( ! empty( $value[0] ) && $value[0] instanceof GF_Query_Column ) {
976
-								$left = $value[0];
975
+							if ( ! empty( $value[ 0 ] ) && $value[ 0 ] instanceof GF_Query_Column ) {
976
+								$left = $value[ 0 ];
977 977
 							} else {
978 978
 								continue;
979 979
 							}
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 							$on = $_join->join_on;
990 990
 							$join = $_join->join;
991 991
 
992
-							$search_conditions[] = GF_Query_Condition::_or(
992
+							$search_conditions[ ] = GF_Query_Condition::_or(
993 993
 								// Join
994 994
 								new GF_Query_Condition(
995 995
 									new GF_Query_Column( GF_Query_Column::META, $join->ID, $query->_alias( GF_Query_Column::META, $join->ID, 'm' ) ),
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
 							);
1006 1006
 						}
1007 1007
 					} else {
1008
-						$search_conditions[] = new GF_Query_Condition(
1008
+						$search_conditions[ ] = new GF_Query_Condition(
1009 1009
 							new GF_Query_Column( $left->field_id, $left->source, $alias ),
1010 1010
 							$search_condition->operator,
1011 1011
 							$search_condition->right
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 		/**
1028 1028
 		 * Combine the parts as a new WHERE clause.
1029 1029
 		 */
1030
-		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts['where'] ), $search_conditions, $extra_conditions ) );
1030
+		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts[ 'where' ] ), $search_conditions, $extra_conditions ) );
1031 1031
 		$query->where( $where );
1032 1032
 	}
1033 1033
 
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
 		$field_id = str_replace( array( 'filter_', 'input_' ), '', $key );
1051 1051
 
1052 1052
 		// calculates field_id, removing 'filter_' and for '_' for advanced fields ( like name or checkbox )
1053
-		if ( preg_match('/^[0-9_]+$/ism', $field_id ) ) {
1053
+		if ( preg_match( '/^[0-9_]+$/ism', $field_id ) ) {
1054 1054
 			$field_id = str_replace( '_', '.', $field_id );
1055 1055
 		}
1056 1056
 
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 			// form is in searchable fields
1108 1108
 			$found = false;
1109 1109
 			foreach ( $searchable_fields as $field ) {
1110
-				if ( $field_id == $field['field'] && $form->ID == $field['form_id'] ) {
1110
+				if ( $field_id == $field[ 'field' ] && $form->ID == $field[ 'form_id' ] ) {
1111 1111
 					$found = true;
1112 1112
 					break;
1113 1113
 				}
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
 
1148 1148
 			case 'select':
1149 1149
 			case 'radio':
1150
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1150
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1151 1151
 				break;
1152 1152
 
1153 1153
 			case 'post_category':
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 
1162 1162
 				foreach ( $value as $val ) {
1163 1163
 					$cat = get_term( $val, 'category' );
1164
-					$filter[] = array(
1164
+					$filter[ ] = array(
1165 1165
 						'key'      => $field_id,
1166 1166
 						'value'    => esc_attr( $cat->name ) . ':' . $val,
1167 1167
 						'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 				$filter = array();
1181 1181
 
1182 1182
 				foreach ( $value as $val ) {
1183
-					$filter[] = array( 'key' => $field_id, 'value' => $val );
1183
+					$filter[ ] = array( 'key' => $field_id, 'value' => $val );
1184 1184
 				}
1185 1185
 
1186 1186
 				break;
@@ -1189,9 +1189,9 @@  discard block
 block discarded – undo
1189 1189
 				// convert checkbox on/off into the correct search filter
1190 1190
 				if ( false !== strpos( $field_id, '.' ) && ! empty( $form_field->inputs ) && ! empty( $form_field->choices ) ) {
1191 1191
 					foreach ( $form_field->inputs as $k => $input ) {
1192
-						if ( $input['id'] == $field_id ) {
1193
-							$filter['value'] = $form_field->choices[ $k ]['value'];
1194
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1192
+						if ( $input[ 'id' ] == $field_id ) {
1193
+							$filter[ 'value' ] = $form_field->choices[ $k ][ 'value' ];
1194
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1195 1195
 							break;
1196 1196
 						}
1197 1197
 					}
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 					$filter = array();
1202 1202
 
1203 1203
 					foreach ( $value as $val ) {
1204
-						$filter[] = array(
1204
+						$filter[ ] = array(
1205 1205
 							'key'      => $field_id,
1206 1206
 							'value'    => $val,
1207 1207
 							'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1222,9 +1222,9 @@  discard block
 block discarded – undo
1222 1222
 					foreach ( $words as $word ) {
1223 1223
 						if ( ! empty( $word ) && strlen( $word ) > 1 ) {
1224 1224
 							// Keep the same key for each filter
1225
-							$filter['value'] = $word;
1225
+							$filter[ 'value' ] = $word;
1226 1226
 							// Add a search for the value
1227
-							$filters[] = $filter;
1227
+							$filters[ ] = $filter;
1228 1228
 						}
1229 1229
 					}
1230 1230
 
@@ -1238,19 +1238,19 @@  discard block
 block discarded – undo
1238 1238
 
1239 1239
 					foreach ( $searchable_fields as $searchable_field ) {
1240 1240
 
1241
-						if( $form_field->ID !== $searchable_field['field'] ) {
1241
+						if ( $form_field->ID !== $searchable_field[ 'field' ] ) {
1242 1242
 							continue;
1243 1243
 						}
1244 1244
 
1245 1245
 						// Only exact-match dropdowns, not text search
1246
-						if( in_array( $searchable_field['input'], array( 'text', 'search' ), true ) ) {
1246
+						if ( in_array( $searchable_field[ 'input' ], array( 'text', 'search' ), true ) ) {
1247 1247
 							continue;
1248 1248
 						}
1249 1249
 
1250 1250
 						$input_id = gravityview_get_input_id_from_id( $form_field->ID );
1251 1251
 
1252 1252
 						if ( 4 === $input_id ) {
1253
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1253
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1254 1254
 						};
1255 1255
 					}
1256 1256
 				}
@@ -1278,12 +1278,12 @@  discard block
 block discarded – undo
1278 1278
 						 * @since 1.16.3
1279 1279
 						 * Safeguard until GF implements '<=' operator
1280 1280
 						 */
1281
-						if( !GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1281
+						if ( ! GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1282 1282
 							$operator = '<';
1283 1283
 							$date = date( 'Y-m-d', strtotime( self::get_formatted_date( $date, 'Y-m-d', $date_format ) . ' +1 day' ) );
1284 1284
 						}
1285 1285
 
1286
-						$filter[] = array(
1286
+						$filter[ ] = array(
1287 1287
 							'key'      => $field_id,
1288 1288
 							'value'    => self::get_formatted_date( $date, 'Y-m-d', $date_format ),
1289 1289
 							'operator' => $this->get_operator( $get, $key, array( $operator ), $operator ),
@@ -1291,12 +1291,12 @@  discard block
 block discarded – undo
1291 1291
 					}
1292 1292
 				} else {
1293 1293
 					$date = $value;
1294
-					$filter['value'] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1295
-					$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1294
+					$filter[ 'value' ] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1295
+					$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1296 1296
 				}
1297 1297
 
1298
-				if ('payment_date' === $key) {
1299
-					$filter['operator'] = 'contains';
1298
+				if ( 'payment_date' === $key ) {
1299
+					$filter[ 'operator' ] = 'contains';
1300 1300
 				}
1301 1301
 
1302 1302
 				break;
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
 			'ymd_dot' => 'Y.m.d',
1326 1326
 		);
1327 1327
 
1328
-		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){
1328
+		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) {
1329 1329
 			$format = $datepicker[ $field->dateFormat ];
1330 1330
 		}
1331 1331
 
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
 	public function add_template_path( $file_paths ) {
1363 1363
 
1364 1364
 		// Index 100 is the default GravityView template path.
1365
-		$file_paths[102] = self::$file . 'templates/';
1365
+		$file_paths[ 102 ] = self::$file . 'templates/';
1366 1366
 
1367 1367
 		return $file_paths;
1368 1368
 	}
@@ -1381,7 +1381,7 @@  discard block
 block discarded – undo
1381 1381
 		$has_date = false;
1382 1382
 
1383 1383
 		foreach ( $search_fields as $k => $field ) {
1384
-			if ( in_array( $field['input'], array( 'date', 'date_range', 'entry_date' ) ) ) {
1384
+			if ( in_array( $field[ 'input' ], array( 'date', 'date_range', 'entry_date' ) ) ) {
1385 1385
 				$has_date = true;
1386 1386
 				break;
1387 1387
 			}
@@ -1410,7 +1410,7 @@  discard block
 block discarded – undo
1410 1410
 		$view = \GV\View::by_id( $gravityview_view->view_id );
1411 1411
 
1412 1412
 		// get configured search fields
1413
-		$search_fields = ! empty( $widget_args['search_fields'] ) ? json_decode( $widget_args['search_fields'], true ) : '';
1413
+		$search_fields = ! empty( $widget_args[ 'search_fields' ] ) ? json_decode( $widget_args[ 'search_fields' ], true ) : '';
1414 1414
 
1415 1415
 		if ( empty( $search_fields ) || ! is_array( $search_fields ) ) {
1416 1416
 			gravityview()->log->debug( 'No search fields configured for widget:', array( 'data' => $widget_args ) );
@@ -1424,39 +1424,39 @@  discard block
 block discarded – undo
1424 1424
 
1425 1425
 			$updated_field = $this->get_search_filter_details( $updated_field, $context );
1426 1426
 
1427
-			switch ( $field['field'] ) {
1427
+			switch ( $field[ 'field' ] ) {
1428 1428
 
1429 1429
 				case 'search_all':
1430
-					$updated_field['key'] = 'search_all';
1431
-					$updated_field['input'] = 'search_all';
1432
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_search' );
1430
+					$updated_field[ 'key' ] = 'search_all';
1431
+					$updated_field[ 'input' ] = 'search_all';
1432
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_search' );
1433 1433
 					break;
1434 1434
 
1435 1435
 				case 'entry_date':
1436
-					$updated_field['key'] = 'entry_date';
1437
-					$updated_field['input'] = 'entry_date';
1438
-					$updated_field['value'] = array(
1436
+					$updated_field[ 'key' ] = 'entry_date';
1437
+					$updated_field[ 'input' ] = 'entry_date';
1438
+					$updated_field[ 'value' ] = array(
1439 1439
 						'start' => $this->rgget_or_rgpost( 'gv_start' ),
1440 1440
 						'end' => $this->rgget_or_rgpost( 'gv_end' ),
1441 1441
 					);
1442 1442
 					break;
1443 1443
 
1444 1444
 				case 'entry_id':
1445
-					$updated_field['key'] = 'entry_id';
1446
-					$updated_field['input'] = 'entry_id';
1447
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_id' );
1445
+					$updated_field[ 'key' ] = 'entry_id';
1446
+					$updated_field[ 'input' ] = 'entry_id';
1447
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_id' );
1448 1448
 					break;
1449 1449
 
1450 1450
 				case 'created_by':
1451
-					$updated_field['key'] = 'created_by';
1452
-					$updated_field['name'] = 'gv_by';
1453
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_by' );
1451
+					$updated_field[ 'key' ] = 'created_by';
1452
+					$updated_field[ 'name' ] = 'gv_by';
1453
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_by' );
1454 1454
 					break;
1455 1455
 
1456 1456
 				case 'is_approved':
1457
-					$updated_field['key'] = 'is_approved';
1458
-					$updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_approved' );
1459
-					$updated_field['choices'] = self::get_is_approved_choices();
1457
+					$updated_field[ 'key' ] = 'is_approved';
1458
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'filter_is_approved' );
1459
+					$updated_field[ 'choices' ] = self::get_is_approved_choices();
1460 1460
 					break;
1461 1461
 			}
1462 1462
 
@@ -1477,16 +1477,16 @@  discard block
 block discarded – undo
1477 1477
 
1478 1478
 		$gravityview_view->permalink_fields = $this->add_no_permalink_fields( array(), $this, $widget_args );
1479 1479
 
1480
-		$gravityview_view->search_layout = ! empty( $widget_args['search_layout'] ) ? $widget_args['search_layout'] : 'horizontal';
1480
+		$gravityview_view->search_layout = ! empty( $widget_args[ 'search_layout' ] ) ? $widget_args[ 'search_layout' ] : 'horizontal';
1481 1481
 
1482 1482
 		/** @since 1.14 */
1483
-		$gravityview_view->search_mode = ! empty( $widget_args['search_mode'] ) ? $widget_args['search_mode'] : 'any';
1483
+		$gravityview_view->search_mode = ! empty( $widget_args[ 'search_mode' ] ) ? $widget_args[ 'search_mode' ] : 'any';
1484 1484
 
1485
-		$custom_class = ! empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
1485
+		$custom_class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
1486 1486
 
1487 1487
 		$gravityview_view->search_class = self::get_search_class( $custom_class );
1488 1488
 
1489
-		$gravityview_view->search_clear = ! empty( $widget_args['search_clear'] ) ? $widget_args['search_clear'] : false;
1489
+		$gravityview_view->search_clear = ! empty( $widget_args[ 'search_clear' ] ) ? $widget_args[ 'search_clear' ] : false;
1490 1490
 
1491 1491
 		if ( $this->has_date_field( $search_fields ) ) {
1492 1492
 			// enqueue datepicker stuff only if needed!
@@ -1508,10 +1508,10 @@  discard block
 block discarded – undo
1508 1508
 	public static function get_search_class( $custom_class = '' ) {
1509 1509
 		$gravityview_view = GravityView_View::getInstance();
1510 1510
 
1511
-		$search_class = 'gv-search-'.$gravityview_view->search_layout;
1511
+		$search_class = 'gv-search-' . $gravityview_view->search_layout;
1512 1512
 
1513
-		if ( ! empty( $custom_class )  ) {
1514
-			$search_class .= ' '.$custom_class;
1513
+		if ( ! empty( $custom_class ) ) {
1514
+			$search_class .= ' ' . $custom_class;
1515 1515
 		}
1516 1516
 
1517 1517
 		/**
@@ -1562,9 +1562,9 @@  discard block
 block discarded – undo
1562 1562
 
1563 1563
 		if ( ! $label ) {
1564 1564
 
1565
-			$label = isset( $form_field['label'] ) ? $form_field['label'] : '';
1565
+			$label = isset( $form_field[ 'label' ] ) ? $form_field[ 'label' ] : '';
1566 1566
 
1567
-			switch( $field['field'] ) {
1567
+			switch ( $field[ 'field' ] ) {
1568 1568
 				case 'search_all':
1569 1569
 					$label = __( 'Search Entries:', 'gk-gravityview' );
1570 1570
 					break;
@@ -1576,10 +1576,10 @@  discard block
 block discarded – undo
1576 1576
 					break;
1577 1577
 				default:
1578 1578
 					// If this is a field input, not a field
1579
-					if ( strpos( $field['field'], '.' ) > 0 && ! empty( $form_field['inputs'] ) ) {
1579
+					if ( strpos( $field[ 'field' ], '.' ) > 0 && ! empty( $form_field[ 'inputs' ] ) ) {
1580 1580
 
1581 1581
 						// Get the label for the field in question, which returns an array
1582
-						$items = wp_list_filter( $form_field['inputs'], array( 'id' => $field['field'] ) );
1582
+						$items = wp_list_filter( $form_field[ 'inputs' ], array( 'id' => $field[ 'field' ] ) );
1583 1583
 
1584 1584
 						// Get the item with the `label` key
1585 1585
 						$values = wp_list_pluck( $items, 'label' );
@@ -1620,13 +1620,13 @@  discard block
 block discarded – undo
1620 1620
 		$form = $gravityview_view->getForm();
1621 1621
 
1622 1622
 		// for advanced field ids (eg, first name / last name )
1623
-		$name = 'filter_' . str_replace( '.', '_', $field['field'] );
1623
+		$name = 'filter_' . str_replace( '.', '_', $field[ 'field' ] );
1624 1624
 
1625 1625
 		// get searched value from $_GET/$_POST (string or array)
1626 1626
 		$value = $this->rgget_or_rgpost( $name );
1627 1627
 
1628 1628
 		// get form field details
1629
-		$form_field = gravityview_get_field( $form, $field['field'] );
1629
+		$form_field = gravityview_get_field( $form, $field[ 'field' ] );
1630 1630
 
1631 1631
 		$form_field_type = \GV\Utils::get( $form_field, 'type' );
1632 1632
 
@@ -1640,22 +1640,22 @@  discard block
 block discarded – undo
1640 1640
 		);
1641 1641
 
1642 1642
 		// collect choices
1643
-		if ( 'post_category' === $form_field_type && ! empty( $form_field['displayAllCategories'] ) && empty( $form_field['choices'] ) ) {
1644
-			$filter['choices'] = gravityview_get_terms_choices();
1645
-		} elseif ( ! empty( $form_field['choices'] ) ) {
1646
-			$filter['choices'] = $form_field['choices'];
1643
+		if ( 'post_category' === $form_field_type && ! empty( $form_field[ 'displayAllCategories' ] ) && empty( $form_field[ 'choices' ] ) ) {
1644
+			$filter[ 'choices' ] = gravityview_get_terms_choices();
1645
+		} elseif ( ! empty( $form_field[ 'choices' ] ) ) {
1646
+			$filter[ 'choices' ] = $form_field[ 'choices' ];
1647 1647
 		}
1648 1648
 
1649
-		if ( 'date_range' === $field['input'] && empty( $value ) ) {
1650
-			$filter['value'] = array( 'start' => '', 'end' => '' );
1649
+		if ( 'date_range' === $field[ 'input' ] && empty( $value ) ) {
1650
+			$filter[ 'value' ] = array( 'start' => '', 'end' => '' );
1651 1651
 		}
1652 1652
 
1653
-		if ( 'created_by' === $field['field'] ) {
1654
-			$filter['choices'] = self::get_created_by_choices( ( isset( $context->view ) ? $context->view : null ) );
1655
-			$filter['type'] = 'created_by';
1653
+		if ( 'created_by' === $field[ 'field' ] ) {
1654
+			$filter[ 'choices' ] = self::get_created_by_choices( ( isset( $context->view ) ? $context->view : null ) );
1655
+			$filter[ 'type' ] = 'created_by';
1656 1656
 		}
1657 1657
 
1658
-		if ( ! empty( $filter['choices'] ) ) {
1658
+		if ( ! empty( $filter[ 'choices' ] ) ) {
1659 1659
 			/**
1660 1660
 			 * @filter `gravityview/search/sieve_choices` Only output used choices for this field.
1661 1661
 			 * @since 2.16 Modified default value to `true`.
@@ -1664,7 +1664,7 @@  discard block
 block discarded – undo
1664 1664
 			 * @param \GV\Context The context.
1665 1665
 			 */
1666 1666
 			if ( apply_filters( 'gravityview/search/sieve_choices', true, $field, $context ) ) {
1667
-				$filter['choices'] = $this->sieve_filter_choices( $filter, $context );
1667
+				$filter[ 'choices' ] = $this->sieve_filter_choices( $filter, $context );
1668 1668
 			}
1669 1669
 		}
1670 1670
 
@@ -1693,22 +1693,22 @@  discard block
 block discarded – undo
1693 1693
 	 * @return array The filter choices.
1694 1694
 	 */
1695 1695
 	private function sieve_filter_choices( $filter, $context ) {
1696
-		if ( empty( $filter['key'] ) || empty( $filter['choices'] ) ) {
1696
+		if ( empty( $filter[ 'key' ] ) || empty( $filter[ 'choices' ] ) ) {
1697 1697
 			return $filter; // @todo Populate plugins might give us empty choices
1698 1698
 		}
1699 1699
 
1700 1700
 		// Allow only created_by and field-ids to be sieved.
1701
-		if ( 'created_by' !== $filter['key'] && ! is_numeric( $filter['key'] ) ) {
1701
+		if ( 'created_by' !== $filter[ 'key' ] && ! is_numeric( $filter[ 'key' ] ) ) {
1702 1702
 			return $filter;
1703 1703
 		}
1704 1704
 
1705 1705
 		$form_id = $context->view->form->ID; // @todo Support multiple forms (joins)
1706 1706
 
1707
-		$cache = new GravityView_Cache( $form_id, [ 'sieve', $filter['key'], $context->view->ID ] );
1707
+		$cache = new GravityView_Cache( $form_id, [ 'sieve', $filter[ 'key' ], $context->view->ID ] );
1708 1708
 
1709 1709
 		$filter_choices = $cache->get();
1710 1710
 
1711
-		if( $filter_choices ) {
1711
+		if ( $filter_choices ) {
1712 1712
 			return $filter_choices;
1713 1713
 		}
1714 1714
 
@@ -1717,13 +1717,13 @@  discard block
 block discarded – undo
1717 1717
 		$entry_table_name = GFFormsModel::get_entry_table_name();
1718 1718
 		$entry_meta_table_name = GFFormsModel::get_entry_meta_table_name();
1719 1719
 
1720
-		$key_like = $wpdb->esc_like( $filter['key'] ) . '.%';
1720
+		$key_like = $wpdb->esc_like( $filter[ 'key' ] ) . '.%';
1721 1721
 
1722 1722
 		switch ( \GV\Utils::get( $filter, 'type' ) ):
1723 1723
 			case 'post_category':
1724 1724
 				$choices = $wpdb->get_col( $wpdb->prepare(
1725 1725
 					"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",
1726
-					$key_like, $filter['key'], $form_id
1726
+					$key_like, $filter[ 'key' ], $form_id
1727 1727
 				) );
1728 1728
 				break;
1729 1729
 			case 'created_by':
@@ -1735,17 +1735,17 @@  discard block
 block discarded – undo
1735 1735
 			default:
1736 1736
 				$choices = $wpdb->get_col( $wpdb->prepare(
1737 1737
 					"SELECT DISTINCT meta_value FROM $entry_meta_table_name WHERE (meta_key LIKE %s OR meta_key = %d) AND form_id = %d",
1738
-					$key_like, $filter['key'], $form_id
1738
+					$key_like, $filter[ 'key' ], $form_id
1739 1739
 				) );
1740 1740
 
1741
-				if ( ( $field = gravityview_get_field( $form_id, $filter['key'] ) ) && 'json' === $field->storageType ) {
1741
+				if ( ( $field = gravityview_get_field( $form_id, $filter[ 'key' ] ) ) && 'json' === $field->storageType ) {
1742 1742
 					$choices = array_map( 'json_decode', $choices );
1743 1743
 					$_choices_array = array();
1744 1744
 					foreach ( $choices as $choice ) {
1745 1745
 						if ( is_array( $choice ) ) {
1746 1746
 							$_choices_array = array_merge( $_choices_array, $choice );
1747 1747
 						} else {
1748
-							$_choices_array []= $choice;
1748
+							$_choices_array [ ] = $choice;
1749 1749
 						}
1750 1750
 					}
1751 1751
 					$choices = array_unique( $_choices_array );
@@ -1755,9 +1755,9 @@  discard block
 block discarded – undo
1755 1755
 		endswitch;
1756 1756
 
1757 1757
 		$filter_choices = array();
1758
-		foreach ( $filter['choices'] as $choice ) {
1759
-			if ( in_array( $choice['text'], $choices, true ) || in_array( $choice['value'], $choices, true ) ) {
1760
-				$filter_choices[] = $choice;
1758
+		foreach ( $filter[ 'choices' ] as $choice ) {
1759
+			if ( in_array( $choice[ 'text' ], $choices, true ) || in_array( $choice[ 'value' ], $choices, true ) ) {
1760
+				$filter_choices[ ] = $choice;
1761 1761
 			}
1762 1762
 		}
1763 1763
 
@@ -1794,7 +1794,7 @@  discard block
 block discarded – undo
1794 1794
 			 * @param \GV\View|null $view The view.
1795 1795
 			 */
1796 1796
 			$text = apply_filters( 'gravityview/search/created_by/text', $user->display_name, $user, $view );
1797
-			$choices[] = array(
1797
+			$choices[ ] = array(
1798 1798
 				'value' => $user->ID,
1799 1799
 				'text' => $text,
1800 1800
 			);
@@ -1814,9 +1814,9 @@  discard block
 block discarded – undo
1814 1814
 
1815 1815
 		$choices = array();
1816 1816
 		foreach ( GravityView_Entry_Approval_Status::get_all() as $status ) {
1817
-			$choices[] = array(
1818
-				'value' => $status['value'],
1819
-				'text' => $status['label'],
1817
+			$choices[ ] = array(
1818
+				'value' => $status[ 'value' ],
1819
+				'text' => $status[ 'label' ],
1820 1820
 			);
1821 1821
 		}
1822 1822
 
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
 	 */
1871 1871
 	public function add_datepicker_js_dependency( $js_dependencies ) {
1872 1872
 
1873
-		$js_dependencies[] = 'jquery-ui-datepicker';
1873
+		$js_dependencies[ ] = 'jquery-ui-datepicker';
1874 1874
 
1875 1875
 		return $js_dependencies;
1876 1876
 	}
@@ -1914,7 +1914,7 @@  discard block
 block discarded – undo
1914 1914
 			'isRTL'             => is_rtl(),
1915 1915
 		), $view_data );
1916 1916
 
1917
-		$localizations['datepicker'] = $datepicker_settings;
1917
+		$localizations[ 'datepicker' ] = $datepicker_settings;
1918 1918
 
1919 1919
 		return $localizations;
1920 1920
 
@@ -1941,7 +1941,7 @@  discard block
 block discarded – undo
1941 1941
 	 * @return void
1942 1942
 	 */
1943 1943
 	private function maybe_enqueue_flexibility() {
1944
-		if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/MSIE [8-9]/', $_SERVER['HTTP_USER_AGENT'] ) ) {
1944
+		if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) && preg_match( '/MSIE [8-9]/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
1945 1945
 			wp_enqueue_script( 'gv-flexibility' );
1946 1946
 		}
1947 1947
 	}
@@ -1963,7 +1963,7 @@  discard block
 block discarded – undo
1963 1963
 		add_filter( 'gravityview_js_localization', array( $this, 'add_datepicker_localization' ), 10, 2 );
1964 1964
 
1965 1965
 		$scheme = is_ssl() ? 'https://' : 'http://';
1966
-		wp_enqueue_style( 'jquery-ui-datepicker', $scheme.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1966
+		wp_enqueue_style( 'jquery-ui-datepicker', $scheme . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1967 1967
 
1968 1968
 		/**
1969 1969
 		 * @filter `gravityview_search_datepicker_class`
@@ -2042,7 +2042,7 @@  discard block
 block discarded – undo
2042 2042
 	public function add_preview_inputs() {
2043 2043
 		global $wp;
2044 2044
 
2045
-		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews') ) {
2045
+		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews' ) ) {
2046 2046
 			return;
2047 2047
 		}
2048 2048
 
@@ -2100,7 +2100,7 @@  discard block
 block discarded – undo
2100 2100
  */
2101 2101
 class GravityView_Widget_Search_Author_GF_Query_Condition extends \GF_Query_Condition {
2102 2102
 	public function __construct( $filter, $view ) {
2103
-		$this->value = $filter['value'];
2103
+		$this->value = $filter[ 'value' ];
2104 2104
 		$this->view = $view;
2105 2105
 	}
2106 2106
 
@@ -2132,11 +2132,11 @@  discard block
 block discarded – undo
2132 2132
 		$conditions = array();
2133 2133
 
2134 2134
 		foreach ( $user_fields as $user_field ) {
2135
-			$conditions[] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) .  '%' );
2135
+			$conditions[ ] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) . '%' );
2136 2136
 		}
2137 2137
 
2138 2138
 		foreach ( $user_meta_fields as $meta_field ) {
2139
-			$conditions[] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) .  '%' );
2139
+			$conditions[ ] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) . '%' );
2140 2140
 		}
2141 2141
 
2142 2142
 		$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.
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.
future/includes/class-gv-shortcode-gravityview.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,9 @@
 block discarded – undo
79 79
 		 * Check permissions.
80 80
 		 */
81 81
 		while ( $error = $view->can_render( array( 'shortcode' ), $request ) ) {
82
-			if ( ! is_wp_error( $error ) )
83
-				break;
82
+			if ( ! is_wp_error( $error ) ) {
83
+							break;
84
+			}
84 85
 
85 86
 			switch ( str_replace( 'gravityview/', '', $error->get_error_code() ) ) {
86 87
 				case 'post_password_required':
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 			'class' => '',
44 44
 		) );
45 45
 
46
-		if ( ! $view_id = $atts['id'] ? : $atts['view_id'] ) {
47
-			if ( $atts['detail'] && $view = $request->is_view() ) {
46
+		if ( ! $view_id = $atts[ 'id' ] ?: $atts[ 'view_id' ] ) {
47
+			if ( $atts[ 'detail' ] && $view = $request->is_view() ) {
48 48
 				$view_id = $view->ID;
49 49
 			}
50 50
 		}
@@ -132,12 +132,12 @@  discard block
 block discarded – undo
132 132
 			}
133 133
 		}
134 134
 
135
-		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID );
135
+		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID );
136 136
 
137 137
 		/**
138 138
 		 * View details.
139 139
 		 */
140
-		if ( $atts['detail'] ) {
140
+		if ( $atts[ 'detail' ] ) {
141 141
 			$entries = $view->get_entries( $request );
142 142
 			return self::_return( $this->detail( $view, $entries, $atts ) );
143 143
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 				return self::_return( '' );
155 155
 			}
156 156
 
157
-			if ( $entry['status'] != 'active' ) {
157
+			if ( $entry[ 'status' ] != 'active' ) {
158 158
 				gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) );
159 159
 				return self::_return( __( 'You are not allowed to view this content.', 'gk-gravityview' ) );
160 160
 			}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 			}
166 166
 
167 167
 			if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
168
-				if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
168
+				if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
169 169
 					gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) );
170 170
 					return self::_return( __( 'You are not allowed to view this content.', 'gk-gravityview' ) );
171 171
 				}
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 			$entryset = $entry->is_multi() ? $entry->entries : array( $entry );
189 189
 
190 190
 			foreach ( $entryset as $e ) {
191
-				if ( $e['status'] != 'active' ) {
191
+				if ( $e[ 'status' ] != 'active' ) {
192 192
 					gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $e->ID ) );
193 193
 					return self::_return( __( 'You are not allowed to view this content.', 'gk-gravityview' ) );
194 194
 				}
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 				}
200 200
 
201 201
 				if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
202
-					if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
202
+					if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
203 203
 						gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $e->ID ) );
204 204
 						return self::_return( __( 'You are not allowed to view this content.', 'gk-gravityview' ) );
205 205
 					}
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
 
225 225
 				// Mock the request with the actual View, not the global one
226 226
 				$mock_request = new \GV\Mock_Request();
227
-				$mock_request->returns['is_view'] = $view;
228
-				$mock_request->returns['is_entry'] = $request->is_entry( $view->form ? $view->form->ID : 0 );
229
-				$mock_request->returns['is_edit_entry'] = $request->is_edit_entry( $view->form ? $view->form->ID : 0 );
230
-				$mock_request->returns['is_search'] = $request->is_search();
227
+				$mock_request->returns[ 'is_view' ] = $view;
228
+				$mock_request->returns[ 'is_entry' ] = $request->is_entry( $view->form ? $view->form->ID : 0 );
229
+				$mock_request->returns[ 'is_edit_entry' ] = $request->is_edit_entry( $view->form ? $view->form->ID : 0 );
230
+				$mock_request->returns[ 'is_search' ] = $request->is_search();
231 231
 
232 232
 				$request = $mock_request;
233 233
 			}
@@ -263,16 +263,16 @@  discard block
 block discarded – undo
263 263
 		$filtered_atts = shortcode_atts( $supported_atts, $passed_atts, 'gravityview' );
264 264
 
265 265
 		// Only keep the passed attributes after making sure that they're valid pairs
266
-		$filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts );
266
+		$filtered_atts = array_intersect_key( (array)$passed_atts, $filtered_atts );
267 267
 
268 268
 		$atts = array();
269 269
 
270
-		foreach( $filtered_atts as $key => $passed_value ) {
270
+		foreach ( $filtered_atts as $key => $passed_value ) {
271 271
 
272 272
 			// Allow using GravityView merge tags in shortcode attributes, like {get} and {created_by}
273 273
 			$passed_value = \GravityView_Merge_Tags::replace_variables( $passed_value );
274 274
 
275
-			switch( $defaults[ $key ]['type'] ) {
275
+			switch ( $defaults[ $key ][ 'type' ] ) {
276 276
 
277 277
 				/**
278 278
 				 * Make sure number fields are numeric.
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 				 * @see http://php.net/manual/en/function.is-numeric.php#107326
281 281
 				 */
282 282
 				case 'number':
283
-					if( is_numeric( $passed_value ) ) {
283
+					if ( is_numeric( $passed_value ) ) {
284 284
 						$atts[ $key ] = ( $passed_value + 0 );
285 285
 					}
286 286
 					break;
@@ -295,8 +295,8 @@  discard block
 block discarded – undo
295 295
 				 */
296 296
 				case 'select':
297 297
 				case 'radio':
298
-					$options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options'];
299
-					if( in_array( $passed_value, array_keys( $options ) ) ) {
298
+					$options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ];
299
+					if ( in_array( $passed_value, array_keys( $options ) ) ) {
300 300
 						$atts[ $key ] = $passed_value;
301 301
 					}
302 302
 					break;
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 			}
309 309
 		}
310 310
 
311
-		$atts['detail'] = \GV\Utils::get( $passed_atts, 'detail', null );
311
+		$atts[ 'detail' ] = \GV\Utils::get( $passed_atts, 'detail', null );
312 312
 
313 313
 		return $atts;
314 314
 	}
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 	private function detail( $view, $entries, $atts ) {
326 326
 		$output = '';
327 327
 
328
-		switch ( $key = $atts['detail'] ):
328
+		switch ( $key = $atts[ 'detail' ] ):
329 329
 			case 'total_entries':
330 330
 				$output = number_format_i18n( $entries->total() );
331 331
 				break;
Please login to merge, or discard this patch.
includes/class-gravityview-shortcode.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 		gravityview()->log->debug( '$passed_atts: ', array( 'data' => $passed_atts ) );
49 49
 
50 50
 		// Get details about the current View
51
-		if( !empty( $passed_atts['detail'] ) ) {
52
-			return $this->get_view_detail( $passed_atts['detail'] );
51
+		if ( ! empty( $passed_atts[ 'detail' ] ) ) {
52
+			return $this->get_view_detail( $passed_atts[ 'detail' ] );
53 53
 		}
54 54
 
55 55
 		$atts = $this->parse_and_sanitize_atts( $passed_atts );
@@ -85,16 +85,16 @@  discard block
 block discarded – undo
85 85
 		$filtered_atts = shortcode_atts( $supported_atts, $passed_atts, 'gravityview' );
86 86
 
87 87
 		// Only keep the passed attributes after making sure that they're valid pairs
88
-		$filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts );
88
+		$filtered_atts = array_intersect_key( (array)$passed_atts, $filtered_atts );
89 89
 
90 90
 		$atts = array();
91 91
 
92
-		foreach( $filtered_atts as $key => $passed_value ) {
92
+		foreach ( $filtered_atts as $key => $passed_value ) {
93 93
 
94 94
 			// Allow using GravityView merge tags in shortcode attributes, like {get} and {created_by}
95 95
 			$passed_value = GravityView_Merge_Tags::replace_variables( $passed_value );
96 96
 
97
-			switch( $defaults[ $key ]['type'] ) {
97
+			switch ( $defaults[ $key ][ 'type' ] ) {
98 98
 
99 99
 				/**
100 100
 				 * Make sure number fields are numeric.
@@ -102,14 +102,14 @@  discard block
 block discarded – undo
102 102
 				 * @see http://php.net/manual/en/function.is-numeric.php#107326
103 103
 				 */
104 104
 				case 'number':
105
-					if( is_numeric( $passed_value ) ) {
105
+					if ( is_numeric( $passed_value ) ) {
106 106
 						$atts[ $key ] = ( $passed_value + 0 );
107 107
 					}
108 108
 					break;
109 109
 
110 110
 				/** @since 2.1 */
111 111
 				case 'operator':
112
-					if( GFFormsModel::is_valid_operator( $passed_value ) ) {
112
+					if ( GFFormsModel::is_valid_operator( $passed_value ) ) {
113 113
 						$atts[ $key ] = $passed_value;
114 114
 					}
115 115
 					break;
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
 				 */
125 125
 				case 'select':
126 126
 				case 'radio':
127
-					$options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options'];
128
-					if( in_array( $passed_value, array_keys( $options ) ) ) {
127
+					$options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ];
128
+					if ( in_array( $passed_value, array_keys( $options ) ) ) {
129 129
 						$atts[ $key ] = $passed_value;
130 130
 					}
131 131
 					break;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		$gravityview_view = GravityView_View::getInstance();
155 155
 		$return = '';
156 156
 
157
-		switch( $detail ) {
157
+		switch ( $detail ) {
158 158
 			case 'total_entries':
159 159
 				$return = number_format_i18n( $gravityview_view->getTotalEntries() );
160 160
 				break;
Please login to merge, or discard this patch.
includes/class-gravityview-extension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
  */
15 15
 abstract class GravityView_Extension extends \GV\Extension {
16 16
 	public function __construct() {
17
-		if( ! in_array( $this->_author, array( 'GravityView', 'Katz Web Services, Inc.', true ) ) ) {
17
+		if ( ! in_array( $this->_author, array( 'GravityView', 'Katz Web Services, Inc.', true ) ) ) {
18 18
 			gravityview()->log->warning( '\GravityView_Extension is deprecated. Inherit from \GV\Extension instead', array( 'data' => $this ) );
19 19
 		}
20 20
 		parent::__construct();
Please login to merge, or discard this patch.