Completed
Pull Request — develop (#1656)
by
unknown
17:57
created
future/lib/EDD_SL_Plugin_Updater.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
 		$this->api_data    = $_api_data;
49 49
 		$this->name        = plugin_basename( $_plugin_file );
50 50
 		$this->slug        = basename( $_plugin_file, '.php' );
51
-		$this->version     = $_api_data['version'];
52
-		$this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
53
-		$this->beta        = ! empty( $this->api_data['beta'] ) ? true : false;
54
-		$this->cache_key   = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
51
+		$this->version     = $_api_data[ 'version' ];
52
+		$this->wp_override = isset( $_api_data[ 'wp_override' ] ) ? (bool)$_api_data[ 'wp_override' ] : false;
53
+		$this->beta        = ! empty( $this->api_data[ 'beta' ] ) ? true : false;
54
+		$this->cache_key   = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data[ 'license' ] . $this->beta ) );
55 55
 
56 56
 		$edd_plugin_data[ $this->slug ] = $this->api_data;
57 57
 
@@ -173,11 +173,11 @@  discard block
 block discarded – undo
173 173
 			return;
174 174
 		}
175 175
 
176
-		if( ! current_user_can( 'update_plugins' ) ) {
176
+		if ( ! current_user_can( 'update_plugins' ) ) {
177 177
 			return;
178 178
 		}
179 179
 
180
-		if( ! is_multisite() ) {
180
+		if ( ! is_multisite() ) {
181 181
 			return;
182 182
 		}
183 183
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 					'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
270 270
 					esc_html( $version_info->new_version ),
271 271
 					'</a>',
272
-					'<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
272
+					'<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) . '">',
273 273
 					'</a>'
274 274
 				);
275 275
 			}
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			$_data->contributors = $this->convert_object_to_array( $_data->contributors );
354 354
 		}
355 355
 
356
-		if( ! isset( $_data->plugin ) ) {
356
+		if ( ! isset( $_data->plugin ) ) {
357 357
 			$_data->plugin = $this->name;
358 358
 		}
359 359
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 
396 396
 		$verify_ssl = $this->verify_ssl();
397 397
 		if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
398
-			$args['sslverify'] = $verify_ssl;
398
+			$args[ 'sslverify' ] = $verify_ssl;
399 399
 		}
400 400
 		return $args;
401 401
 
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
 		if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
424 424
 			$test_url_parts = parse_url( $this->api_url );
425 425
 
426
-			$scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme']     : 'http';
427
-			$host   = ! empty( $test_url_parts['host'] )   ? $test_url_parts['host']       : '';
428
-			$port   = ! empty( $test_url_parts['port'] )   ? ':' . $test_url_parts['port'] : '';
426
+			$scheme = ! empty( $test_url_parts[ 'scheme' ] ) ? $test_url_parts[ 'scheme' ] : 'http';
427
+			$host   = ! empty( $test_url_parts[ 'host' ] ) ? $test_url_parts[ 'host' ] : '';
428
+			$port   = ! empty( $test_url_parts[ 'port' ] ) ? ':' . $test_url_parts[ 'port' ] : '';
429 429
 
430 430
 			if ( empty( $host ) ) {
431 431
 				$edd_plugin_url_available[ $store_hash ] = false;
@@ -442,27 +442,27 @@  discard block
 block discarded – undo
442 442
 
443 443
 		$data = array_merge( $this->api_data, $_data );
444 444
 
445
-		if ( $data['slug'] != $this->slug ) {
445
+		if ( $data[ 'slug' ] != $this->slug ) {
446 446
 			return false;
447 447
 		}
448 448
 
449
-		if ( $this->api_url == trailingslashit ( home_url() ) ) {
449
+		if ( $this->api_url == trailingslashit( home_url() ) ) {
450 450
 			return false; // Don't allow a plugin to ping itself
451 451
 		}
452 452
 
453 453
 		$api_params = array(
454 454
 			'edd_action' => 'get_version',
455
-			'license'    => ! empty( $data['license'] ) ? $data['license'] : '',
456
-			'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
457
-			'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
458
-			'version'    => isset( $data['version'] ) ? $data['version'] : false,
459
-			'slug'       => $data['slug'],
460
-			'author'     => $data['author'],
455
+			'license'    => ! empty( $data[ 'license' ] ) ? $data[ 'license' ] : '',
456
+			'item_name'  => isset( $data[ 'item_name' ] ) ? $data[ 'item_name' ] : false,
457
+			'item_id'    => isset( $data[ 'item_id' ] ) ? $data[ 'item_id' ] : false,
458
+			'version'    => isset( $data[ 'version' ] ) ? $data[ 'version' ] : false,
459
+			'slug'       => $data[ 'slug' ],
460
+			'author'     => $data[ 'author' ],
461 461
 			'url'        => home_url(),
462
-			'beta'       => ! empty( $data['beta'] ),
462
+			'beta'       => ! empty( $data[ 'beta' ] ),
463 463
 		);
464 464
 
465
-		$request    = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
465
+		$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
466 466
 
467 467
 		if ( ! is_wp_error( $request ) ) {
468 468
 			$request = json_decode( wp_remote_retrieve_body( $request ) );
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
 		}
484 484
 
485 485
 		if ( ! empty( $request->sections ) ) {
486
-			foreach( $request->sections as $key => $section ) {
487
-				$request->$key = (array) $section;
486
+			foreach ( $request->sections as $key => $section ) {
487
+				$request->$key = (array)$section;
488 488
 			}
489 489
 		}
490 490
 
@@ -498,35 +498,35 @@  discard block
 block discarded – undo
498 498
 
499 499
 		global $edd_plugin_data;
500 500
 
501
-		if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
501
+		if ( empty( $_REQUEST[ 'edd_sl_action' ] ) || 'view_plugin_changelog' != $_REQUEST[ 'edd_sl_action' ] ) {
502 502
 			return;
503 503
 		}
504 504
 
505
-		if( empty( $_REQUEST['plugin'] ) ) {
505
+		if ( empty( $_REQUEST[ 'plugin' ] ) ) {
506 506
 			return;
507 507
 		}
508 508
 
509
-		if( empty( $_REQUEST['slug'] ) ) {
509
+		if ( empty( $_REQUEST[ 'slug' ] ) ) {
510 510
 			return;
511 511
 		}
512 512
 
513
-		if( ! current_user_can( 'update_plugins' ) ) {
513
+		if ( ! current_user_can( 'update_plugins' ) ) {
514 514
 			wp_die( __( 'You do not have permission to install plugin updates', 'gravityview' ), __( 'Error', 'gravityview' ), array( 'response' => 403 ) );
515 515
 		}
516 516
 
517
-		$data         = $edd_plugin_data[ $_REQUEST['slug'] ];
517
+		$data         = $edd_plugin_data[ $_REQUEST[ 'slug' ] ];
518 518
 		$version_info = $this->get_cached_version_info();
519 519
 
520
-		if( false === $version_info ) {
520
+		if ( false === $version_info ) {
521 521
 
522 522
 			$api_params = array(
523 523
 				'edd_action' => 'get_version',
524
-				'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
525
-				'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
526
-				'slug'       => $_REQUEST['slug'],
527
-				'author'     => $data['author'],
524
+				'item_name'  => isset( $data[ 'item_name' ] ) ? $data[ 'item_name' ] : false,
525
+				'item_id'    => isset( $data[ 'item_id' ] ) ? $data[ 'item_id' ] : false,
526
+				'slug'       => $_REQUEST[ 'slug' ],
527
+				'author'     => $data[ 'author' ],
528 528
 				'url'        => home_url(),
529
-				'beta'       => ! empty( $data['beta'] )
529
+				'beta'       => ! empty( $data[ 'beta' ] )
530 530
 			);
531 531
 
532 532
 			$verify_ssl = $this->verify_ssl();
@@ -542,22 +542,22 @@  discard block
 block discarded – undo
542 542
 				$version_info = false;
543 543
 			}
544 544
 
545
-			if( ! empty( $version_info ) ) {
546
-				foreach( $version_info->sections as $key => $section ) {
547
-					$version_info->$key = (array) $section;
545
+			if ( ! empty( $version_info ) ) {
546
+				foreach ( $version_info->sections as $key => $section ) {
547
+					$version_info->$key = (array)$section;
548 548
 				}
549 549
 			}
550 550
 
551 551
 			$this->set_version_info_cache( $version_info );
552 552
 
553 553
 			// Delete the unneeded option
554
-			delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $this->beta . '_version_info' ) );
554
+			delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST[ 'plugin' ] ) . '_' . $this->beta . '_version_info' ) );
555 555
 		}
556 556
 
557 557
 		if ( isset( $version_info->sections ) ) {
558 558
 			$sections = $this->convert_object_to_array( $version_info->sections );
559
-			if ( ! empty( $sections['changelog'] ) ) {
560
-				echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>';
559
+			if ( ! empty( $sections[ 'changelog' ] ) ) {
560
+				echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections[ 'changelog' ] ) . '</div>';
561 561
 			}
562 562
 		}
563 563
 
@@ -572,25 +572,25 @@  discard block
 block discarded – undo
572 572
 	 */
573 573
 	public function get_cached_version_info( $cache_key = '' ) {
574 574
 
575
-		if( empty( $cache_key ) ) {
575
+		if ( empty( $cache_key ) ) {
576 576
 			$cache_key = $this->cache_key;
577 577
 		}
578 578
 
579 579
 		$cache = get_option( $cache_key );
580 580
 
581
-		if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
581
+		if ( empty( $cache[ 'timeout' ] ) || time() > $cache[ 'timeout' ] ) {
582 582
 			return false; // Cache is expired
583 583
 		}
584 584
 
585 585
 		// We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
586
-		$cache['value'] = json_decode( $cache['value'] );
587
-		if ( ! empty( $cache['value']->icons ) ) {
588
-			$cache['value']->icons = (array) $cache['value']->icons;
589
-		} elseif ( $cache['value'] ) {
590
-			$cache['value']->icons = array();
586
+		$cache[ 'value' ] = json_decode( $cache[ 'value' ] );
587
+		if ( ! empty( $cache[ 'value' ]->icons ) ) {
588
+			$cache[ 'value' ]->icons = (array)$cache[ 'value' ]->icons;
589
+		} elseif ( $cache[ 'value' ] ) {
590
+			$cache[ 'value' ]->icons = array();
591 591
 		}
592 592
 
593
-		return $cache['value'];
593
+		return $cache[ 'value' ];
594 594
 
595 595
 	}
596 596
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 	 */
603 603
 	public function set_version_info_cache( $value = '', $cache_key = '' ) {
604 604
 
605
-		if( empty( $cache_key ) ) {
605
+		if ( empty( $cache_key ) ) {
606 606
 			$cache_key = $this->cache_key;
607 607
 		}
608 608
 
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
 		update_option( $cache_key, $data, 'no' );
615 615
 
616 616
 		// Delete the duplicate option
617
-		delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) );
617
+		delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data[ 'license' ] . $this->beta ) ) );
618 618
 	}
619 619
 
620 620
 	/**
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 	 * @return bool
625 625
 	 */
626 626
 	private function verify_ssl() {
627
-		return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
627
+		return (bool)apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
628 628
 	}
629 629
 
630 630
 }
Please login to merge, or discard this patch.
includes/class-gravityview-change-entry-creator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			array(
84 84
 				'ajaxurl'  => admin_url( 'admin-ajax.php' ),
85 85
 				'action'   => 'entry_creator_get_users',
86
-				'gf25'    => (bool) gravityview()->plugin->is_GF_25(),
86
+				'gf25'    => (bool)gravityview()->plugin->is_GF_25(),
87 87
 				'language' => array(
88 88
 					'search_placeholder' => esc_html__( 'Search by ID, login, email, or name.', 'gravityview' ),
89 89
 				),
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 			)
108 108
 		);
109 109
 
110
-		if ( ! wp_verify_nonce( $post_var['gv_nonce'], 'gv_entry_creator' ) ) {
110
+		if ( ! wp_verify_nonce( $post_var[ 'gv_nonce' ], 'gv_entry_creator' ) ) {
111 111
 			die();
112 112
 		}
113 113
 
114
-		$search_string = $post_var['q'];
114
+		$search_string = $post_var[ 'q' ];
115 115
 
116 116
 		if ( is_numeric( $search_string ) ) {
117 117
 			$user_args = array(
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		}
159 159
 
160 160
 		// Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing
161
-		$result = RGFormsModel::update_entry_property( (int) $entry['id'], 'created_by', (int) $user_id, false, true );
161
+		$result = RGFormsModel::update_entry_property( (int)$entry[ 'id' ], 'created_by', (int)$user_id, false, true );
162 162
 
163 163
 		if ( false === $result ) {
164 164
 			$status = __( 'Error', 'gravityview' );
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			return;
181 181
 		}
182 182
 
183
-		GravityView_Entry_Notes::add_note( $entry['id'], - 1, 'GravityView', $note, 'gravityview' );
183
+		GravityView_Entry_Notes::add_note( $entry[ 'id' ], - 1, 'GravityView', $note, 'gravityview' );
184 184
 
185 185
 	}
186 186
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 		}
216 216
 
217 217
 		// If screen mode isn't set, then we're in the wrong place.
218
-		if ( empty( $_REQUEST['screen_mode'] ) ) {
218
+		if ( empty( $_REQUEST[ 'screen_mode' ] ) ) {
219 219
 			return;
220 220
 		}
221 221
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
 		// If $_GET['screen_mode'] is set to edit, set $_POST value
243 243
 		if ( \GV\Utils::_GET( 'screen_mode' ) === 'edit' ) {
244
-			$_POST["screen_mode"] = 'edit';
244
+			$_POST[ "screen_mode" ] = 'edit';
245 245
 		}
246 246
 
247 247
 	}
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		$entry_creator_user_id = \GV\Utils::get( $entry, 'created_by' );
317 317
 
318 318
 		$entry_creator_user = GVCommon::get_users( 'change_entry_creator', array( 'include' => $entry_creator_user_id ) );
319
-		$entry_creator_user = isset( $entry_creator_user[0] ) ? $entry_creator_user[0] : array();
319
+		$entry_creator_user = isset( $entry_creator_user[ 0 ] ) ? $entry_creator_user[ 0 ] : array();
320 320
 
321 321
 		$output .= '<option value="0" ' . selected( true, empty( $entry_creator_user_id ), false ) . '> &mdash; ' . esc_attr_x( 'No User', 'No user assigned to the entry', 'gravityview' ) . ' &mdash; </option>';
322 322
 
@@ -335,18 +335,18 @@  discard block
 block discarded – undo
335 335
 		}
336 336
 
337 337
 		$user_count      = count_users();
338
-		$user_count      = $user_count['total_users'];
338
+		$user_count      = $user_count[ 'total_users' ];
339 339
 		$users_displayed = self::DEFAULT_NUMBER_OF_USERS + ( ! empty( $entry_creator_user ) ? 1 : 0 );
340 340
 		if ( $user_count > $users_displayed ) {
341 341
 			$remaining_users = $user_count - $users_displayed;
342
-			$user_users = _n( esc_html__('user', 'gravityview' ), esc_html__('users', 'gravityview' ), $remaining_users );
342
+			$user_users = _n( esc_html__( 'user', 'gravityview' ), esc_html__( 'users', 'gravityview' ), $remaining_users );
343 343
 			$message = esc_html_x( 'Use the input above to search the remaining %d %s.', '%d is replaced with user count %s is replaced with "user" or "users"', 'gravityview' );
344 344
 			$message = sprintf( $message, $remaining_users, $user_users );
345
-			$output  .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
345
+			$output .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
346 346
 		}
347 347
 
348 348
 		$output .= '</select>';
349
-		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry['created_by'] ) . '" type="hidden" />';
349
+		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry[ 'created_by' ] ) . '" type="hidden" />';
350 350
 		$output .= wp_nonce_field( 'gv_entry_creator', 'gv_entry_creator_nonce', false, false );
351 351
 
352 352
 		echo $output;
@@ -360,8 +360,8 @@  discard block
 block discarded – undo
360 360
 	 * @return array
361 361
 	 */
362 362
 	function register_gform_noconflict( $assets ) {
363
-		$assets[] = 'gravityview_selectwoo';
364
-		$assets[] = 'gravityview_entry_creator';
363
+		$assets[ ] = 'gravityview_selectwoo';
364
+		$assets[ ] = 'gravityview_entry_creator';
365 365
 
366 366
 		return $assets;
367 367
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-survey.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 		foreach ( $field->choices as $choice ) {
49 49
 			if ( is_array( $value ) && RGFormsModel::choice_value_match( $field, $choice, $value[ $input_id ] ) ) {
50
-				return $choice['score'];
50
+				return $choice[ 'score' ];
51 51
 			} else if ( ! is_array( $value ) && RGFormsModel::choice_value_match( $field, $choice, $value ) ) {
52
-				return $choice['score'];
52
+				return $choice[ 'score' ];
53 53
 			}
54 54
 		}
55 55
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
60 60
 
61
-		unset( $field_options['search_filter'] );
61
+		unset( $field_options[ 'search_filter' ] );
62 62
 
63 63
 		if ( 'edit' === $context ) {
64 64
 			return $field_options;
@@ -80,18 +80,18 @@  discard block
 block discarded – undo
80 80
 				'text' => __( 'Text value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix ),
81 81
 			);
82 82
 
83
-			if( $field->field->gsurveyLikertEnableScoring ) {
84
-				$likert_display_options['score'] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix );
83
+			if ( $field->field->gsurveyLikertEnableScoring ) {
84
+				$likert_display_options[ 'score' ] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix );
85 85
 			}
86 86
 
87 87
 			// Maintain for back-compatibility
88
-			$add_options['score'] = array(
88
+			$add_options[ 'score' ] = array(
89 89
 				'type' => 'hidden',
90 90
 				'value' => '',
91 91
 				'group' => 'display',
92 92
 			);
93 93
 
94
-			$add_options['choice_display'] = array(
94
+			$add_options[ 'choice_display' ] = array(
95 95
 				'type' => 'radio',
96 96
 				'label' => __( 'What should be displayed:', 'gravityview' ),
97 97
 				'options' => $likert_display_options,
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 			);
104 104
 		}
105 105
 
106
-		if( 'checkbox' === $field->field->inputType && $input_id ) {
107
-			$field_options['choice_display'] = array(
106
+		if ( 'checkbox' === $field->field->inputType && $input_id ) {
107
+			$field_options[ 'choice_display' ] = array(
108 108
 				'type'    => 'radio',
109 109
 				'class'   => 'vertical',
110 110
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		}
121 121
 
122 122
 		if ( 'rating' === $field->field->inputType ) {
123
-			$field_options['choice_display'] = array(
123
+			$field_options[ 'choice_display' ] = array(
124 124
 				'type'    => 'radio',
125 125
 				'class'   => 'vertical',
126 126
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.
includes/widgets/search-widget/class-search-widget.php 1 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 ) {
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 				$value = is_array( $value ) ? array_map( 'trim', $value ) : trim( $value );
729 729
 			}
730 730
 
731
-			if ( 0 !== strpos( $key, 'filter_' ) || gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[0], false, false ) ) ) {
731
+			if ( 0 !== strpos( $key, 'filter_' ) || gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[ 0 ], false, false ) ) ) {
732 732
 				continue; // Not a filter, or empty
733 733
 			}
734 734
 
@@ -742,21 +742,21 @@  discard block
 block discarded – undo
742 742
 				continue;
743 743
 			}
744 744
 
745
-			if ( ! isset( $filter['operator'] ) ) {
746
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
745
+			if ( ! isset( $filter[ 'operator' ] ) ) {
746
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
747 747
 			}
748 748
 
749
-			if ( isset( $filter[0]['value'] ) ) {
750
-				$filter[0]['value'] = $trim_search_value ? trim( $filter[0]['value'] ) : $filter[0]['value'];
749
+			if ( isset( $filter[ 0 ][ 'value' ] ) ) {
750
+				$filter[ 0 ][ 'value' ] = $trim_search_value ? trim( $filter[ 0 ][ 'value' ] ) : $filter[ 0 ][ 'value' ];
751 751
 
752
-				$search_criteria['field_filters'] = array_merge( $search_criteria['field_filters'], $filter );
752
+				$search_criteria[ 'field_filters' ] = array_merge( $search_criteria[ 'field_filters' ], $filter );
753 753
 
754 754
 				// if date range type, set search mode to ALL
755
-				if ( ! empty( $filter[0]['operator'] ) && in_array( $filter[0]['operator'], array( '>=', '<=', '>', '<' ) ) ) {
755
+				if ( ! empty( $filter[ 0 ][ 'operator' ] ) && in_array( $filter[ 0 ][ 'operator' ], array( '>=', '<=', '>', '<' ) ) ) {
756 756
 					$mode = 'all';
757 757
 				}
758
-			} elseif( !empty( $filter ) ) {
759
-				$search_criteria['field_filters'][] = $filter;
758
+			} elseif ( ! empty( $filter ) ) {
759
+				$search_criteria[ 'field_filters' ][ ] = $filter;
760 760
 			}
761 761
 		}
762 762
 
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 		 * @since 1.5.1
766 766
 		 * @param[out,in] string $mode Search mode (`any` vs `all`)
767 767
 		 */
768
-		$search_criteria['field_filters']['mode'] = apply_filters( 'gravityview/search/mode', $mode );
768
+		$search_criteria[ 'field_filters' ][ 'mode' ] = apply_filters( 'gravityview/search/mode', $mode );
769 769
 
770 770
 		gravityview()->log->debug( 'Returned Search Criteria: ', array( 'data' => $search_criteria ) );
771 771
 
@@ -799,19 +799,19 @@  discard block
 block discarded – undo
799 799
 
800 800
 		$query_class = $view->get_query_class();
801 801
 
802
-		if ( empty( $search_criteria['field_filters'] ) ) {
802
+		if ( empty( $search_criteria[ 'field_filters' ] ) ) {
803 803
 			return;
804 804
 		}
805 805
 
806 806
 		$widgets = $view->widgets->by_id( $this->widget_id );
807 807
 		if ( $widgets->count() ) {
808 808
 			$widgets = $widgets->all();
809
-			$widget  = $widgets[0];
809
+			$widget  = $widgets[ 0 ];
810 810
 
811 811
 			$search_fields = json_decode( $widget->configuration->get( 'search_fields' ), true );
812 812
 
813
-			foreach ( (array) $search_fields as $search_field ) {
814
-				if ( 'created_by' === $search_field['field'] && 'input_text' === $search_field['input'] ) {
813
+			foreach ( (array)$search_fields as $search_field ) {
814
+				if ( 'created_by' === $search_field[ 'field' ] && 'input_text' === $search_field[ 'input' ] ) {
815 815
 					$created_by_text_mode = true;
816 816
 				}
817 817
 			}
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 		$extra_conditions = array();
821 821
 		$mode = 'any';
822 822
 
823
-		foreach ( $search_criteria['field_filters'] as &$filter ) {
823
+		foreach ( $search_criteria[ 'field_filters' ] as &$filter ) {
824 824
 			if ( ! is_array( $filter ) ) {
825 825
 				if ( in_array( strtolower( $filter ), array( 'any', 'all' ) ) ) {
826 826
 					$mode = $filter;
@@ -829,13 +829,13 @@  discard block
 block discarded – undo
829 829
 			}
830 830
 
831 831
 			// Construct a manual query for unapproved statuses
832
-			if ( 'is_approved' === $filter['key'] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array) $filter['value'] ) ) {
833
-				$_tmp_query       = new $query_class( $view->form->ID, array(
832
+			if ( 'is_approved' === $filter[ 'key' ] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array)$filter[ 'value' ] ) ) {
833
+				$_tmp_query = new $query_class( $view->form->ID, array(
834 834
 					'field_filters' => array(
835 835
 						array(
836 836
 							'operator' => 'in',
837 837
 							'key'      => 'is_approved',
838
-							'value'    => (array) $filter['value'],
838
+							'value'    => (array)$filter[ 'value' ],
839 839
 						),
840 840
 						array(
841 841
 							'operator' => 'is',
@@ -847,30 +847,30 @@  discard block
 block discarded – undo
847 847
 				) );
848 848
 				$_tmp_query_parts = $_tmp_query->_introspect();
849 849
 
850
-				$extra_conditions[] = $_tmp_query_parts['where'];
850
+				$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
851 851
 
852 852
 				$filter = false;
853 853
 				continue;
854 854
 			}
855 855
 
856 856
 			// Construct manual query for text mode creator search
857
-			if ( 'created_by' === $filter['key'] && ! empty( $created_by_text_mode ) ) {
858
-				$extra_conditions[] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
857
+			if ( 'created_by' === $filter[ 'key' ] && ! empty( $created_by_text_mode ) ) {
858
+				$extra_conditions[ ] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
859 859
 				$filter = false;
860 860
 				continue;
861 861
 			}
862 862
 
863 863
 			// By default, we want searches to be wildcard for each field.
864
-			$filter['operator'] = empty( $filter['operator'] ) ? 'contains' : $filter['operator'];
864
+			$filter[ 'operator' ] = empty( $filter[ 'operator' ] ) ? 'contains' : $filter[ 'operator' ];
865 865
 
866 866
 			// For multichoice, let's have an in (OR) search.
867
-			if ( is_array( $filter['value'] ) ) {
868
-				$filter['operator'] = 'in'; // @todo what about in contains (OR LIKE chains)?
867
+			if ( is_array( $filter[ 'value' ] ) ) {
868
+				$filter[ 'operator' ] = 'in'; // @todo what about in contains (OR LIKE chains)?
869 869
 			}
870 870
 
871 871
 			// Default form with joins functionality
872
-			if ( empty( $filter['form_id'] ) ) {
873
-				$filter['form_id'] = $view->form ? $view->form->ID : 0;
872
+			if ( empty( $filter[ 'form_id' ] ) ) {
873
+				$filter[ 'form_id' ] = $view->form ? $view->form->ID : 0;
874 874
 			}
875 875
 
876 876
 			/**
@@ -880,28 +880,28 @@  discard block
 block discarded – undo
880 880
 			 * @param array $filter array with `key`, `value`, `operator`, `type` keys
881 881
 			 * @param \GV\View $view The View we're operating on.
882 882
 			 */
883
-			$filter['operator'] = apply_filters( 'gravityview_search_operator', $filter['operator'], $filter, $view );
883
+			$filter[ 'operator' ] = apply_filters( 'gravityview_search_operator', $filter[ 'operator' ], $filter, $view );
884 884
 		}
885 885
 
886
-		if ( ! empty( $search_criteria['start_date'] ) || ! empty( $search_criteria['end_date'] ) ) {
886
+		if ( ! empty( $search_criteria[ 'start_date' ] ) || ! empty( $search_criteria[ 'end_date' ] ) ) {
887 887
 			$date_criteria = array();
888 888
 
889
-			if ( isset( $search_criteria['start_date'] ) ) {
890
-				$date_criteria['start_date'] = $search_criteria['start_date'];
889
+			if ( isset( $search_criteria[ 'start_date' ] ) ) {
890
+				$date_criteria[ 'start_date' ] = $search_criteria[ 'start_date' ];
891 891
 			}
892 892
 
893
-			if ( isset( $search_criteria['end_date'] ) ) {
894
-				$date_criteria['end_date'] = $search_criteria['end_date'];
893
+			if ( isset( $search_criteria[ 'end_date' ] ) ) {
894
+				$date_criteria[ 'end_date' ] = $search_criteria[ 'end_date' ];
895 895
 			}
896 896
 
897 897
 			$_tmp_query         = new $query_class( $view->form->ID, $date_criteria );
898 898
 			$_tmp_query_parts   = $_tmp_query->_introspect();
899
-			$extra_conditions[] = $_tmp_query_parts['where'];
899
+			$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
900 900
 		}
901 901
 
902 902
 		$search_conditions = array();
903 903
 
904
-		if ( $filters = array_filter( $search_criteria['field_filters'] ) ) {
904
+		if ( $filters = array_filter( $search_criteria[ 'field_filters' ] ) ) {
905 905
 			foreach ( $filters as &$filter ) {
906 906
 				if ( ! is_array( $filter ) ) {
907 907
 					continue;
@@ -913,12 +913,12 @@  discard block
 block discarded – undo
913 913
 				 * code by reusing what's inside GF_Query already as they
914 914
 				 * take care of many small things like forcing numeric, etc.
915 915
 				 */
916
-				$_tmp_query       = new $query_class( $filter['form_id'], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
916
+				$_tmp_query       = new $query_class( $filter[ 'form_id' ], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
917 917
 				$_tmp_query_parts = $_tmp_query->_introspect();
918
-				$search_condition = $_tmp_query_parts['where'];
918
+				$search_condition = $_tmp_query_parts[ 'where' ];
919 919
 
920
-				if ( empty( $filter['key'] ) && $search_condition->expressions ) {
921
-					$search_conditions[] = $search_condition;
920
+				if ( empty( $filter[ 'key' ] ) && $search_condition->expressions ) {
921
+					$search_conditions[ ] = $search_condition;
922 922
 				} else {
923 923
 					$left = $search_condition->left;
924 924
 					$alias = $query->_alias( $left->field_id, $left->source, $left->is_entry_column() ? 't' : 'm' );
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
 							$on = $_join->join_on;
929 929
 							$join = $_join->join;
930 930
 
931
-							$search_conditions[] = GF_Query_Condition::_or(
931
+							$search_conditions[ ] = GF_Query_Condition::_or(
932 932
 								// Join
933 933
 								new GF_Query_Condition(
934 934
 									new GF_Query_Column( GF_Query_Column::META, $join->ID, $query->_alias( GF_Query_Column::META, $join->ID, 'm' ) ),
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
 							);
945 945
 						}
946 946
 					} else {
947
-						$search_conditions[] = new GF_Query_Condition(
947
+						$search_conditions[ ] = new GF_Query_Condition(
948 948
 							new GF_Query_Column( $left->field_id, $left->source, $alias ),
949 949
 							$search_condition->operator,
950 950
 							$search_condition->right
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 		/**
967 967
 		 * Combine the parts as a new WHERE clause.
968 968
 		 */
969
-		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts['where'] ), $search_conditions, $extra_conditions ) );
969
+		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts[ 'where' ] ), $search_conditions, $extra_conditions ) );
970 970
 		$query->where( $where );
971 971
 	}
972 972
 
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 		$field_id = str_replace( 'filter_', '', $key );
990 990
 
991 991
 		// calculates field_id, removing 'filter_' and for '_' for advanced fields ( like name or checkbox )
992
-		if ( preg_match('/^[0-9_]+$/ism', $field_id ) ) {
992
+		if ( preg_match( '/^[0-9_]+$/ism', $field_id ) ) {
993 993
 			$field_id = str_replace( '_', '.', $field_id );
994 994
 		}
995 995
 
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 			// form is in searchable fields
1047 1047
 			$found = false;
1048 1048
 			foreach ( $searchable_fields as $field ) {
1049
-				if ( $field_id == $field['field'] && $form->ID == $field['form_id'] ) {
1049
+				if ( $field_id == $field[ 'field' ] && $form->ID == $field[ 'form_id' ] ) {
1050 1050
 					$found = true;
1051 1051
 					break;
1052 1052
 				}
@@ -1086,7 +1086,7 @@  discard block
 block discarded – undo
1086 1086
 
1087 1087
 			case 'select':
1088 1088
 			case 'radio':
1089
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1089
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1090 1090
 				break;
1091 1091
 
1092 1092
 			case 'post_category':
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 
1101 1101
 				foreach ( $value as $val ) {
1102 1102
 					$cat = get_term( $val, 'category' );
1103
-					$filter[] = array(
1103
+					$filter[ ] = array(
1104 1104
 						'key'      => $field_id,
1105 1105
 						'value'    => esc_attr( $cat->name ) . ':' . $val,
1106 1106
 						'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 				$filter = array();
1120 1120
 
1121 1121
 				foreach ( $value as $val ) {
1122
-					$filter[] = array( 'key' => $field_id, 'value' => $val );
1122
+					$filter[ ] = array( 'key' => $field_id, 'value' => $val );
1123 1123
 				}
1124 1124
 
1125 1125
 				break;
@@ -1128,9 +1128,9 @@  discard block
 block discarded – undo
1128 1128
 				// convert checkbox on/off into the correct search filter
1129 1129
 				if ( false !== strpos( $field_id, '.' ) && ! empty( $form_field->inputs ) && ! empty( $form_field->choices ) ) {
1130 1130
 					foreach ( $form_field->inputs as $k => $input ) {
1131
-						if ( $input['id'] == $field_id ) {
1132
-							$filter['value'] = $form_field->choices[ $k ]['value'];
1133
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1131
+						if ( $input[ 'id' ] == $field_id ) {
1132
+							$filter[ 'value' ] = $form_field->choices[ $k ][ 'value' ];
1133
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1134 1134
 							break;
1135 1135
 						}
1136 1136
 					}
@@ -1140,7 +1140,7 @@  discard block
 block discarded – undo
1140 1140
 					$filter = array();
1141 1141
 
1142 1142
 					foreach ( $value as $val ) {
1143
-						$filter[] = array(
1143
+						$filter[ ] = array(
1144 1144
 							'key'      => $field_id,
1145 1145
 							'value'    => $val,
1146 1146
 							'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1161,9 +1161,9 @@  discard block
 block discarded – undo
1161 1161
 					foreach ( $words as $word ) {
1162 1162
 						if ( ! empty( $word ) && strlen( $word ) > 1 ) {
1163 1163
 							// Keep the same key for each filter
1164
-							$filter['value'] = $word;
1164
+							$filter[ 'value' ] = $word;
1165 1165
 							// Add a search for the value
1166
-							$filters[] = $filter;
1166
+							$filters[ ] = $filter;
1167 1167
 						}
1168 1168
 					}
1169 1169
 
@@ -1177,19 +1177,19 @@  discard block
 block discarded – undo
1177 1177
 
1178 1178
 					foreach ( $searchable_fields as $searchable_field ) {
1179 1179
 
1180
-						if( $form_field->ID !== $searchable_field['field'] ) {
1180
+						if ( $form_field->ID !== $searchable_field[ 'field' ] ) {
1181 1181
 							continue;
1182 1182
 						}
1183 1183
 
1184 1184
 						// Only exact-match dropdowns, not text search
1185
-						if( in_array( $searchable_field['input'], array( 'text', 'search' ), true ) ) {
1185
+						if ( in_array( $searchable_field[ 'input' ], array( 'text', 'search' ), true ) ) {
1186 1186
 							continue;
1187 1187
 						}
1188 1188
 
1189 1189
 						$input_id = gravityview_get_input_id_from_id( $form_field->ID );
1190 1190
 
1191 1191
 						if ( 4 === $input_id ) {
1192
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1192
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1193 1193
 						};
1194 1194
 					}
1195 1195
 				}
@@ -1217,12 +1217,12 @@  discard block
 block discarded – undo
1217 1217
 						 * @since 1.16.3
1218 1218
 						 * Safeguard until GF implements '<=' operator
1219 1219
 						 */
1220
-						if( !GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1220
+						if ( ! GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1221 1221
 							$operator = '<';
1222 1222
 							$date = date( 'Y-m-d', strtotime( self::get_formatted_date( $date, 'Y-m-d', $date_format ) . ' +1 day' ) );
1223 1223
 						}
1224 1224
 
1225
-						$filter[] = array(
1225
+						$filter[ ] = array(
1226 1226
 							'key'      => $field_id,
1227 1227
 							'value'    => self::get_formatted_date( $date, 'Y-m-d', $date_format ),
1228 1228
 							'operator' => $this->get_operator( $get, $key, array( $operator ), $operator ),
@@ -1230,12 +1230,12 @@  discard block
 block discarded – undo
1230 1230
 					}
1231 1231
 				} else {
1232 1232
 					$date = $value;
1233
-					$filter['value'] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1234
-					$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1233
+					$filter[ 'value' ] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1234
+					$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1235 1235
 				}
1236 1236
 
1237
-				if ('payment_date' === $key) {
1238
-					$filter['operator'] = 'contains';
1237
+				if ( 'payment_date' === $key ) {
1238
+					$filter[ 'operator' ] = 'contains';
1239 1239
 				}
1240 1240
 
1241 1241
 				break;
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
 			'ymd_dot' => 'Y.m.d',
1265 1265
 		);
1266 1266
 
1267
-		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){
1267
+		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) {
1268 1268
 			$format = $datepicker[ $field->dateFormat ];
1269 1269
 		}
1270 1270
 
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 	public function add_template_path( $file_paths ) {
1302 1302
 
1303 1303
 		// Index 100 is the default GravityView template path.
1304
-		$file_paths[102] = self::$file . 'templates/';
1304
+		$file_paths[ 102 ] = self::$file . 'templates/';
1305 1305
 
1306 1306
 		return $file_paths;
1307 1307
 	}
@@ -1320,7 +1320,7 @@  discard block
 block discarded – undo
1320 1320
 		$has_date = false;
1321 1321
 
1322 1322
 		foreach ( $search_fields as $k => $field ) {
1323
-			if ( in_array( $field['input'], array( 'date', 'date_range', 'entry_date' ) ) ) {
1323
+			if ( in_array( $field[ 'input' ], array( 'date', 'date_range', 'entry_date' ) ) ) {
1324 1324
 				$has_date = true;
1325 1325
 				break;
1326 1326
 			}
@@ -1349,7 +1349,7 @@  discard block
 block discarded – undo
1349 1349
 		$view = \GV\View::by_id( $gravityview_view->view_id );
1350 1350
 
1351 1351
 		// get configured search fields
1352
-		$search_fields = ! empty( $widget_args['search_fields'] ) ? json_decode( $widget_args['search_fields'], true ) : '';
1352
+		$search_fields = ! empty( $widget_args[ 'search_fields' ] ) ? json_decode( $widget_args[ 'search_fields' ], true ) : '';
1353 1353
 
1354 1354
 		if ( empty( $search_fields ) || ! is_array( $search_fields ) ) {
1355 1355
 			gravityview()->log->debug( 'No search fields configured for widget:', array( 'data' => $widget_args ) );
@@ -1363,39 +1363,39 @@  discard block
 block discarded – undo
1363 1363
 
1364 1364
 			$updated_field = $this->get_search_filter_details( $updated_field, $context );
1365 1365
 
1366
-			switch ( $field['field'] ) {
1366
+			switch ( $field[ 'field' ] ) {
1367 1367
 
1368 1368
 				case 'search_all':
1369
-					$updated_field['key'] = 'search_all';
1370
-					$updated_field['input'] = 'search_all';
1371
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_search' );
1369
+					$updated_field[ 'key' ] = 'search_all';
1370
+					$updated_field[ 'input' ] = 'search_all';
1371
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_search' );
1372 1372
 					break;
1373 1373
 
1374 1374
 				case 'entry_date':
1375
-					$updated_field['key'] = 'entry_date';
1376
-					$updated_field['input'] = 'entry_date';
1377
-					$updated_field['value'] = array(
1375
+					$updated_field[ 'key' ] = 'entry_date';
1376
+					$updated_field[ 'input' ] = 'entry_date';
1377
+					$updated_field[ 'value' ] = array(
1378 1378
 						'start' => $this->rgget_or_rgpost( 'gv_start' ),
1379 1379
 						'end' => $this->rgget_or_rgpost( 'gv_end' ),
1380 1380
 					);
1381 1381
 					break;
1382 1382
 
1383 1383
 				case 'entry_id':
1384
-					$updated_field['key'] = 'entry_id';
1385
-					$updated_field['input'] = 'entry_id';
1386
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_id' );
1384
+					$updated_field[ 'key' ] = 'entry_id';
1385
+					$updated_field[ 'input' ] = 'entry_id';
1386
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_id' );
1387 1387
 					break;
1388 1388
 
1389 1389
 				case 'created_by':
1390
-					$updated_field['key'] = 'created_by';
1391
-					$updated_field['name'] = 'gv_by';
1392
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_by' );
1390
+					$updated_field[ 'key' ] = 'created_by';
1391
+					$updated_field[ 'name' ] = 'gv_by';
1392
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_by' );
1393 1393
 					break;
1394 1394
 
1395 1395
 				case 'is_approved':
1396
-					$updated_field['key'] = 'is_approved';
1397
-					$updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_approved' );
1398
-					$updated_field['choices'] = self::get_is_approved_choices();
1396
+					$updated_field[ 'key' ] = 'is_approved';
1397
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'filter_is_approved' );
1398
+					$updated_field[ 'choices' ] = self::get_is_approved_choices();
1399 1399
 					break;
1400 1400
 			}
1401 1401
 
@@ -1416,16 +1416,16 @@  discard block
 block discarded – undo
1416 1416
 
1417 1417
 		$gravityview_view->permalink_fields = $this->add_no_permalink_fields( array(), $this, $widget_args );
1418 1418
 
1419
-		$gravityview_view->search_layout = ! empty( $widget_args['search_layout'] ) ? $widget_args['search_layout'] : 'horizontal';
1419
+		$gravityview_view->search_layout = ! empty( $widget_args[ 'search_layout' ] ) ? $widget_args[ 'search_layout' ] : 'horizontal';
1420 1420
 
1421 1421
 		/** @since 1.14 */
1422
-		$gravityview_view->search_mode = ! empty( $widget_args['search_mode'] ) ? $widget_args['search_mode'] : 'any';
1422
+		$gravityview_view->search_mode = ! empty( $widget_args[ 'search_mode' ] ) ? $widget_args[ 'search_mode' ] : 'any';
1423 1423
 
1424
-		$custom_class = ! empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
1424
+		$custom_class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
1425 1425
 
1426 1426
 		$gravityview_view->search_class = self::get_search_class( $custom_class );
1427 1427
 
1428
-		$gravityview_view->search_clear = ! empty( $widget_args['search_clear'] ) ? $widget_args['search_clear'] : false;
1428
+		$gravityview_view->search_clear = ! empty( $widget_args[ 'search_clear' ] ) ? $widget_args[ 'search_clear' ] : false;
1429 1429
 
1430 1430
 		if ( $this->has_date_field( $search_fields ) ) {
1431 1431
 			// enqueue datepicker stuff only if needed!
@@ -1447,10 +1447,10 @@  discard block
 block discarded – undo
1447 1447
 	public static function get_search_class( $custom_class = '' ) {
1448 1448
 		$gravityview_view = GravityView_View::getInstance();
1449 1449
 
1450
-		$search_class = 'gv-search-'.$gravityview_view->search_layout;
1450
+		$search_class = 'gv-search-' . $gravityview_view->search_layout;
1451 1451
 
1452
-		if ( ! empty( $custom_class )  ) {
1453
-			$search_class .= ' '.$custom_class;
1452
+		if ( ! empty( $custom_class ) ) {
1453
+			$search_class .= ' ' . $custom_class;
1454 1454
 		}
1455 1455
 
1456 1456
 		/**
@@ -1501,9 +1501,9 @@  discard block
 block discarded – undo
1501 1501
 
1502 1502
 		if ( ! $label ) {
1503 1503
 
1504
-			$label = isset( $form_field['label'] ) ? $form_field['label'] : '';
1504
+			$label = isset( $form_field[ 'label' ] ) ? $form_field[ 'label' ] : '';
1505 1505
 
1506
-			switch( $field['field'] ) {
1506
+			switch ( $field[ 'field' ] ) {
1507 1507
 				case 'search_all':
1508 1508
 					$label = __( 'Search Entries:', 'gravityview' );
1509 1509
 					break;
@@ -1515,10 +1515,10 @@  discard block
 block discarded – undo
1515 1515
 					break;
1516 1516
 				default:
1517 1517
 					// If this is a field input, not a field
1518
-					if ( strpos( $field['field'], '.' ) > 0 && ! empty( $form_field['inputs'] ) ) {
1518
+					if ( strpos( $field[ 'field' ], '.' ) > 0 && ! empty( $form_field[ 'inputs' ] ) ) {
1519 1519
 
1520 1520
 						// Get the label for the field in question, which returns an array
1521
-						$items = wp_list_filter( $form_field['inputs'], array( 'id' => $field['field'] ) );
1521
+						$items = wp_list_filter( $form_field[ 'inputs' ], array( 'id' => $field[ 'field' ] ) );
1522 1522
 
1523 1523
 						// Get the item with the `label` key
1524 1524
 						$values = wp_list_pluck( $items, 'label' );
@@ -1559,13 +1559,13 @@  discard block
 block discarded – undo
1559 1559
 		$form = $gravityview_view->getForm();
1560 1560
 
1561 1561
 		// for advanced field ids (eg, first name / last name )
1562
-		$name = 'filter_' . str_replace( '.', '_', $field['field'] );
1562
+		$name = 'filter_' . str_replace( '.', '_', $field[ 'field' ] );
1563 1563
 
1564 1564
 		// get searched value from $_GET/$_POST (string or array)
1565 1565
 		$value = $this->rgget_or_rgpost( $name );
1566 1566
 
1567 1567
 		// get form field details
1568
-		$form_field = gravityview_get_field( $form, $field['field'] );
1568
+		$form_field = gravityview_get_field( $form, $field[ 'field' ] );
1569 1569
 
1570 1570
 		$form_field_type = \GV\Utils::get( $form_field, 'type' );
1571 1571
 
@@ -1579,22 +1579,22 @@  discard block
 block discarded – undo
1579 1579
 		);
1580 1580
 
1581 1581
 		// collect choices
1582
-		if ( 'post_category' === $form_field_type && ! empty( $form_field['displayAllCategories'] ) && empty( $form_field['choices'] ) ) {
1583
-			$filter['choices'] = gravityview_get_terms_choices();
1584
-		} elseif ( ! empty( $form_field['choices'] ) ) {
1585
-			$filter['choices'] = $form_field['choices'];
1582
+		if ( 'post_category' === $form_field_type && ! empty( $form_field[ 'displayAllCategories' ] ) && empty( $form_field[ 'choices' ] ) ) {
1583
+			$filter[ 'choices' ] = gravityview_get_terms_choices();
1584
+		} elseif ( ! empty( $form_field[ 'choices' ] ) ) {
1585
+			$filter[ 'choices' ] = $form_field[ 'choices' ];
1586 1586
 		}
1587 1587
 
1588
-		if ( 'date_range' === $field['input'] && empty( $value ) ) {
1589
-			$filter['value'] = array( 'start' => '', 'end' => '' );
1588
+		if ( 'date_range' === $field[ 'input' ] && empty( $value ) ) {
1589
+			$filter[ 'value' ] = array( 'start' => '', 'end' => '' );
1590 1590
 		}
1591 1591
 
1592
-		if ( 'created_by' === $field['field'] ) {
1593
-			$filter['choices'] = self::get_created_by_choices( $context->view );
1594
-			$filter['type'] = 'created_by';
1592
+		if ( 'created_by' === $field[ 'field' ] ) {
1593
+			$filter[ 'choices' ] = self::get_created_by_choices( $context->view );
1594
+			$filter[ 'type' ] = 'created_by';
1595 1595
 		}
1596 1596
 
1597
-		if ( ! empty( $filter['choices'] ) ) {
1597
+		if ( ! empty( $filter[ 'choices' ] ) ) {
1598 1598
 			/**
1599 1599
 			 * @filter `gravityview/search/sieve_choices` Only output used choices for this field.
1600 1600
 			 * @param[in,out] bool Yes or no.
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
 			 * @param \GV\Context The context.
1603 1603
 			 */
1604 1604
 			if ( apply_filters( 'gravityview/search/sieve_choices', false, $field, $context ) ) {
1605
-				$filter['choices'] = $this->sieve_filter_choices( $filter, $context );
1605
+				$filter[ 'choices' ] = $this->sieve_filter_choices( $filter, $context );
1606 1606
 			}
1607 1607
 		}
1608 1608
 
@@ -1631,12 +1631,12 @@  discard block
 block discarded – undo
1631 1631
 	 * @return array The filter choices.
1632 1632
 	 */
1633 1633
 	private function sieve_filter_choices( $filter, $context ) {
1634
-		if ( empty( $filter['key'] ) || empty( $filter['choices'] ) ) {
1634
+		if ( empty( $filter[ 'key' ] ) || empty( $filter[ 'choices' ] ) ) {
1635 1635
 			return $filter; // @todo Populate plugins might give us empty choices
1636 1636
 		}
1637 1637
 
1638 1638
 		// Allow only created_by and field-ids to be sieved.
1639
-		if ( 'created_by' !== $filter['key'] && ! is_numeric( $filter['key'] ) ) {
1639
+		if ( 'created_by' !== $filter[ 'key' ] && ! is_numeric( $filter[ 'key' ] ) ) {
1640 1640
 			return $filter;
1641 1641
 		}
1642 1642
 
@@ -1647,13 +1647,13 @@  discard block
 block discarded – undo
1647 1647
 		$entry_table_name = GFFormsModel::get_entry_table_name();
1648 1648
 		$entry_meta_table_name = GFFormsModel::get_entry_meta_table_name();
1649 1649
 
1650
-		$key_like = $wpdb->esc_like( $filter['key'] ) . '.%';
1650
+		$key_like = $wpdb->esc_like( $filter[ 'key' ] ) . '.%';
1651 1651
 
1652 1652
 		switch ( \GV\Utils::get( $filter, 'type' ) ):
1653 1653
 			case 'post_category':
1654 1654
 				$choices = $wpdb->get_col( $wpdb->prepare(
1655 1655
 					"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",
1656
-					$key_like, $filter['key'], $form_id
1656
+					$key_like, $filter[ 'key' ], $form_id
1657 1657
 				) );
1658 1658
 				break;
1659 1659
 			case 'created_by':
@@ -1665,17 +1665,17 @@  discard block
 block discarded – undo
1665 1665
 			default:
1666 1666
 				$choices = $wpdb->get_col( $wpdb->prepare(
1667 1667
 					"SELECT DISTINCT meta_value FROM $entry_meta_table_name WHERE (meta_key LIKE %s OR meta_key = %d) AND form_id = %d",
1668
-					$key_like, $filter['key'], $form_id
1668
+					$key_like, $filter[ 'key' ], $form_id
1669 1669
 				) );
1670 1670
 
1671
-				if ( ( $field = gravityview_get_field( $form_id, $filter['key'] ) ) && 'json' === $field->storageType ) {
1671
+				if ( ( $field = gravityview_get_field( $form_id, $filter[ 'key' ] ) ) && 'json' === $field->storageType ) {
1672 1672
 					$choices = array_map( 'json_decode', $choices );
1673 1673
 					$_choices_array = array();
1674 1674
 					foreach ( $choices as $choice ) {
1675 1675
 						if ( is_array( $choice ) ) {
1676 1676
 							$_choices_array = array_merge( $_choices_array, $choice );
1677 1677
 						} else {
1678
-							$_choices_array []= $choice;
1678
+							$_choices_array [ ] = $choice;
1679 1679
 						}
1680 1680
 					}
1681 1681
 					$choices = array_unique( $_choices_array );
@@ -1685,9 +1685,9 @@  discard block
 block discarded – undo
1685 1685
 		endswitch;
1686 1686
 
1687 1687
 		$filter_choices = array();
1688
-		foreach ( $filter['choices'] as $choice ) {
1689
-			if ( in_array( $choice['text'], $choices, true ) || in_array( $choice['value'], $choices, true ) ) {
1690
-				$filter_choices[] = $choice;
1688
+		foreach ( $filter[ 'choices' ] as $choice ) {
1689
+			if ( in_array( $choice[ 'text' ], $choices, true ) || in_array( $choice[ 'value' ], $choices, true ) ) {
1690
+				$filter_choices[ ] = $choice;
1691 1691
 			}
1692 1692
 		}
1693 1693
 
@@ -1722,7 +1722,7 @@  discard block
 block discarded – undo
1722 1722
 			 * @param \GV\View $view The view.
1723 1723
 			 */
1724 1724
 			$text = apply_filters( 'gravityview/search/created_by/text', $user->display_name, $user, $view );
1725
-			$choices[] = array(
1725
+			$choices[ ] = array(
1726 1726
 				'value' => $user->ID,
1727 1727
 				'text' => $text,
1728 1728
 			);
@@ -1742,9 +1742,9 @@  discard block
 block discarded – undo
1742 1742
 
1743 1743
 		$choices = array();
1744 1744
 		foreach ( GravityView_Entry_Approval_Status::get_all() as $status ) {
1745
-			$choices[] = array(
1746
-				'value' => $status['value'],
1747
-				'text' => $status['label'],
1745
+			$choices[ ] = array(
1746
+				'value' => $status[ 'value' ],
1747
+				'text' => $status[ 'label' ],
1748 1748
 			);
1749 1749
 		}
1750 1750
 
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
 	 */
1797 1797
 	public function add_datepicker_js_dependency( $js_dependencies ) {
1798 1798
 
1799
-		$js_dependencies[] = 'jquery-ui-datepicker';
1799
+		$js_dependencies[ ] = 'jquery-ui-datepicker';
1800 1800
 
1801 1801
 		return $js_dependencies;
1802 1802
 	}
@@ -1840,7 +1840,7 @@  discard block
 block discarded – undo
1840 1840
 			'isRTL'             => is_rtl(),
1841 1841
 		), $view_data );
1842 1842
 
1843
-		$localizations['datepicker'] = $datepicker_settings;
1843
+		$localizations[ 'datepicker' ] = $datepicker_settings;
1844 1844
 
1845 1845
 		return $localizations;
1846 1846
 
@@ -1867,7 +1867,7 @@  discard block
 block discarded – undo
1867 1867
 	 * @return void
1868 1868
 	 */
1869 1869
 	private function maybe_enqueue_flexibility() {
1870
-		if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/MSIE [8-9]/', $_SERVER['HTTP_USER_AGENT'] ) ) {
1870
+		if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) && preg_match( '/MSIE [8-9]/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
1871 1871
 			wp_enqueue_script( 'gv-flexibility' );
1872 1872
 		}
1873 1873
 	}
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
 		add_filter( 'gravityview_js_localization', array( $this, 'add_datepicker_localization' ), 10, 2 );
1890 1890
 
1891 1891
 		$scheme = is_ssl() ? 'https://' : 'http://';
1892
-		wp_enqueue_style( 'jquery-ui-datepicker', $scheme.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1892
+		wp_enqueue_style( 'jquery-ui-datepicker', $scheme . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1893 1893
 
1894 1894
 		/**
1895 1895
 		 * @filter `gravityview_search_datepicker_class`
@@ -1968,7 +1968,7 @@  discard block
 block discarded – undo
1968 1968
 	public function add_preview_inputs() {
1969 1969
 		global $wp;
1970 1970
 
1971
-		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews') ) {
1971
+		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews' ) ) {
1972 1972
 			return;
1973 1973
 		}
1974 1974
 
@@ -2020,7 +2020,7 @@  discard block
 block discarded – undo
2020 2020
  */
2021 2021
 class GravityView_Widget_Search_Author_GF_Query_Condition extends \GF_Query_Condition {
2022 2022
 	public function __construct( $filter, $view ) {
2023
-		$this->value = $filter['value'];
2023
+		$this->value = $filter[ 'value' ];
2024 2024
 		$this->view = $view;
2025 2025
 	}
2026 2026
 
@@ -2052,11 +2052,11 @@  discard block
 block discarded – undo
2052 2052
 		$conditions = array();
2053 2053
 
2054 2054
 		foreach ( $user_fields as $user_field ) {
2055
-			$conditions[] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) .  '%' );
2055
+			$conditions[ ] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) . '%' );
2056 2056
 		}
2057 2057
 
2058 2058
 		foreach ( $user_meta_fields as $meta_field ) {
2059
-			$conditions[] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) .  '%' );
2059
+			$conditions[ ] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) . '%' );
2060 2060
 		}
2061 2061
 
2062 2062
 		$conditions = '(' . implode( ' OR ', $conditions ) . ')';
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/select-template.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -26,52 +26,52 @@
 block discarded – undo
26 26
 
27 27
 <?php // list all the available templates (type= fresh or custom ) ?>
28 28
 <div class="gv-grid">
29
-	<?php foreach( $templates as $id => $template ) {
29
+	<?php foreach ( $templates as $id => $template ) {
30 30
 		$selected     = ( $id == $current_template ) ? ' gv-selected' : '';
31
-		$placeholder  = ! empty( $template['buy_source'] );
32
-		$is_included  = ! empty( $template['included'] );
31
+		$placeholder  = ! empty( $template[ 'buy_source' ] );
32
+		$is_included  = ! empty( $template[ 'included' ] );
33 33
 		$plugin_data  = GravityView_Admin_Installer::get_wp_plugins_data( \GV\Utils::get( $template, 'textdomain', '' ) );
34 34
 		$button_text  = empty( $plugin_data ) ? esc_html__( 'Install Layout', 'gravityview' ) : esc_html__( 'Activate & Select Layout', 'gravityview' );
35 35
 		$button_class = 'gv-layout-' . ( empty( $plugin_data ) ? 'install' : 'activate' );
36
-		$template_path = isset($plugin_data['path']) ? $plugin_data['path'] : '';
36
+		$template_path = isset( $plugin_data[ 'path' ] ) ? $plugin_data[ 'path' ] : '';
37 37
 
38 38
 		?>
39 39
 		<div class="gv-grid-col-1-4">
40
-			<div class="gv-view-types-module<?php echo $selected; if( $placeholder ) { echo ' gv-view-template-placeholder'; } ?>" data-filter="<?php echo esc_attr( $template['type'] ); ?>">
40
+			<div class="gv-view-types-module<?php echo $selected; if ( $placeholder ) { echo ' gv-view-template-placeholder'; } ?>" data-filter="<?php echo esc_attr( $template[ 'type' ] ); ?>">
41 41
 				<div class="gv-view-types-normal">
42
-					<img src="<?php echo esc_url( $template['logo'] ); ?>" alt="<?php echo esc_attr( $template['label'] ); ?>">
43
-					<h5><?php echo esc_html( $template['label'] ); ?></h5>
44
-					<p class="description"><?php echo esc_html( $template['description'] ); ?></p>
42
+					<img src="<?php echo esc_url( $template[ 'logo' ] ); ?>" alt="<?php echo esc_attr( $template[ 'label' ] ); ?>">
43
+					<h5><?php echo esc_html( $template[ 'label' ] ); ?></h5>
44
+					<p class="description"><?php echo esc_html( $template[ 'description' ] ); ?></p>
45 45
 				</div>
46 46
 				<div class="gv-view-types-hover">
47 47
 					<div>
48 48
 						<?php
49
-						if( $is_included ) {
49
+						if ( $is_included ) {
50 50
 						?>
51 51
 							<p><a href="<?php echo esc_url( admin_url( 'edit.php?post_type=gravityview&page=gv-admin-installer' ) ); ?>" class="button button-secondary button-hero <?php echo $button_class; ?>" rel="internal" data-template-path="<?php echo $template_path; ?>"><?php echo $button_text; ?></a></p>
52
-							<?php if( !empty( $template['license'] ) ) { ?>
53
-								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), esc_html( str_replace( ' ', '&nbsp;', $template['license'] ) ) ); ?></p>
52
+							<?php if ( ! empty( $template[ 'license' ] ) ) { ?>
53
+								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), esc_html( str_replace( ' ', '&nbsp;', $template[ 'license' ] ) ) ); ?></p>
54 54
 							<?php } ?>
55 55
 						<?php
56
-						} elseif( $placeholder ) {
57
-							$utm_string = '?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=' . urlencode( $template['license'] ) . '&utm_content=' . urlencode( $template['slug'] );
56
+						} elseif ( $placeholder ) {
57
+							$utm_string = '?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=' . urlencode( $template[ 'license' ] ) . '&utm_content=' . urlencode( $template[ 'slug' ] );
58 58
 							?>
59
-							<p><a href="<?php echo esc_url( $template['buy_source'] ); ?>" class="button button-primary button-hero" rel="noreferrer noopener external"><?php esc_html_e( 'Buy Now', 'gravityview'); ?></a></p>
59
+							<p><a href="<?php echo esc_url( $template[ 'buy_source' ] ); ?>" class="button button-primary button-hero" rel="noreferrer noopener external"><?php esc_html_e( 'Buy Now', 'gravityview' ); ?></a></p>
60 60
 
61
-							<?php if( !empty( $template['preview'] ) ) { ?>
62
-								<p><a href="<?php echo esc_url( $template['preview'] ); ?>" rel="noreferrer noopener external" class="button button-secondary"><i class="dashicons dashicons-external" style="vertical-align: middle;" title="<?php esc_html_e( 'View a live demo of this layout', 'gravityview'); ?>"></i> <?php esc_html_e( 'Try a demo', 'gravityview' ); ?></a></p>
61
+							<?php if ( ! empty( $template[ 'preview' ] ) ) { ?>
62
+								<p><a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="noreferrer noopener external" class="button button-secondary"><i class="dashicons dashicons-external" style="vertical-align: middle;" title="<?php esc_html_e( 'View a live demo of this layout', 'gravityview' ); ?>"></i> <?php esc_html_e( 'Try a demo', 'gravityview' ); ?></a></p>
63 63
 							<?php } ?>
64 64
 
65
-							<?php if( ! empty( $template['license'] ) ) { ?>
66
-								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), '<a href="https://gravityview.co/pricing/' . esc_attr( $utm_string ) . '" rel="noreferrer noopener external">' . esc_html( str_replace( ' ', '&nbsp;', $template['license'] ) ) . '</a>' ); ?></p>
65
+							<?php if ( ! empty( $template[ 'license' ] ) ) { ?>
66
+								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), '<a href="https://gravityview.co/pricing/' . esc_attr( $utm_string ) . '" rel="noreferrer noopener external">' . esc_html( str_replace( ' ', '&nbsp;', $template[ 'license' ] ) ) . '</a>' ); ?></p>
67 67
 							<?php } ?>
68 68
 						<?php }
69 69
 
70
-						if ($placeholder || $is_included) { ?> </div><div class="hidden"> <?php } ?>
70
+						if ( $placeholder || $is_included ) { ?> </div><div class="hidden"> <?php } ?>
71 71
 
72
-                        <p><a href="#gv_select_template" role="button" class="gv_select_template button button-hero button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview'); ?></a></p>
73
-                        <?php if( !empty( $template['preview'] ) ) { ?>
74
-                            <a href="<?php echo esc_url( $template['preview'] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-welcome-view-site" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview'); ?>"></i></a>
72
+                        <p><a href="#gv_select_template" role="button" class="gv_select_template button button-hero button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview' ); ?></a></p>
73
+                        <?php if ( ! empty( $template[ 'preview' ] ) ) { ?>
74
+                            <a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-welcome-view-site" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview' ); ?>"></i></a>
75 75
                         <?php } ?>
76 76
 					</div>
77 77
 				</div>
Please login to merge, or discard this patch.
includes/class-admin-views.php 1 patch
Spacing   +171 added lines, -171 removed lines patch added patch discarded remove patch
@@ -27,32 +27,32 @@  discard block
 block discarded – undo
27 27
 		add_filter( 'gravityview_blacklist_field_types', array( $this, 'default_field_blacklist' ), 10, 2 );
28 28
 
29 29
 		// Tooltips
30
-		add_filter( 'gform_tooltips', array( $this, 'tooltips') );
30
+		add_filter( 'gform_tooltips', array( $this, 'tooltips' ) );
31 31
 
32 32
 		// adding styles and scripts
33
-		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles'), 999 );
34
-		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict') );
35
-		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict') );
36
-		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict') );
37
-		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict') );
38
-
39
-		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas'), 10, 4 );
40
-		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas'), 10, 3 );
41
-		add_action( 'gravityview_render_field_pickers', array( $this, 'render_field_pickers'), 10, 2 );
42
-		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields'), 10, 2 );
43
-		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets') );
44
-		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas'), 10, 5 );
33
+		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles' ), 999 );
34
+		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict' ) );
35
+		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict' ) );
36
+		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict' ) );
37
+		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) );
38
+
39
+		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas' ), 10, 4 );
40
+		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas' ), 10, 3 );
41
+		add_action( 'gravityview_render_field_pickers', array( $this, 'render_field_pickers' ), 10, 2 );
42
+		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields' ), 10, 2 );
43
+		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets' ) );
44
+		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas' ), 10, 5 );
45 45
 
46 46
 		// @todo check if this hook is needed..
47 47
 		//add_action( 'gravityview_render_field_options', array( $this, 'render_field_options'), 10, 9 );
48 48
 
49 49
 		// Add Connected Form column
50
-		add_filter('manage_gravityview_posts_columns' , array( $this, 'add_post_type_columns' ) );
50
+		add_filter( 'manage_gravityview_posts_columns', array( $this, 'add_post_type_columns' ) );
51 51
 
52 52
 		add_filter( 'gform_toolbar_menu', array( 'GravityView_Admin_Views', 'gform_toolbar_menu' ), 10, 2 );
53 53
 		add_action( 'gform_form_actions', array( 'GravityView_Admin_Views', 'gform_toolbar_menu' ), 10, 2 );
54 54
 
55
-		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content'), 10, 2 );
55
+		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content' ), 10, 2 );
56 56
 
57 57
 		add_action( 'restrict_manage_posts', array( $this, 'add_view_dropdown' ) );
58 58
 
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	function suggest_support_articles( $localization_data = array() ) {
72 72
 
73
-	    if( ! gravityview()->request->is_view() ) {
73
+	    if ( ! gravityview()->request->is_view() ) {
74 74
 	        return $localization_data;
75 75
         }
76 76
 
77
-		$localization_data['suggest'] = array(
77
+		$localization_data[ 'suggest' ] = array(
78 78
             '57ef23539033602e61d4a560',
79 79
             '54c67bb9e4b0512429885513',
80 80
             '54c67bb9e4b0512429885512',
@@ -103,20 +103,20 @@  discard block
 block discarded – undo
103 103
 			return;
104 104
 		}
105 105
 
106
-		if ( ! isset( $query->query_vars['post_type'] ) ) {
106
+		if ( ! isset( $query->query_vars[ 'post_type' ] ) ) {
107 107
 			return;
108 108
 		}
109 109
 
110
-		if ( 'gravityview' !== $query->query_vars['post_type'] ) {
110
+		if ( 'gravityview' !== $query->query_vars[ 'post_type' ] ) {
111 111
 			return;
112 112
 		}
113 113
 
114
-		$form_id = (int) \GV\Utils::_GET( 'gravityview_form_id' );
114
+		$form_id = (int)\GV\Utils::_GET( 'gravityview_form_id' );
115 115
 
116 116
 		$meta_query = array();
117 117
 
118 118
 		if ( $form_id ) {
119
-			$meta_query[] = array(
119
+			$meta_query[ ] = array(
120 120
 					'key'   => '_gravityview_form_id',
121 121
 					'value' => $form_id,
122 122
 			);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		$layout_id = \GV\Utils::_GET( 'gravityview_layout' );
126 126
 
127 127
 		if ( $layout_id ) {
128
-			$meta_query[] = array(
128
+			$meta_query[ ] = array(
129 129
 					'key'   => '_gravityview_directory_template',
130 130
 					'value' => esc_attr( $layout_id ),
131 131
 			);
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	public function add_view_dropdown() {
143 143
 		$current_screen = get_current_screen();
144 144
 
145
-		if( 'gravityview' !== $current_screen->post_type ) {
145
+		if ( 'gravityview' !== $current_screen->post_type ) {
146 146
 			return;
147 147
 		}
148 148
 
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
 		$current_form = \GV\Utils::_GET( 'gravityview_form_id' );
151 151
 
152 152
 		// If there are no forms to select, show no forms.
153
-		if( ! empty( $forms ) ) { ?>
153
+		if ( ! empty( $forms ) ) { ?>
154 154
 			<label for="gravityview_form_id" class="screen-reader-text"><?php esc_html_e( 'Filter Views by form', 'gravityview' ); ?></label>
155 155
 			<select name="gravityview_form_id" id="gravityview_form_id">
156 156
 				<option value="" <?php selected( '', $current_form, true ); ?>><?php esc_html_e( 'All forms', 'gravityview' ); ?></option>
157
-				<?php foreach( $forms as $form ) { ?>
158
-					<option value="<?php echo esc_attr( $form['id'] ); ?>" <?php selected( $form['id'], $current_form, true ); ?>><?php echo esc_html( $form['title'] ); ?></option>
157
+				<?php foreach ( $forms as $form ) { ?>
158
+					<option value="<?php echo esc_attr( $form[ 'id' ] ); ?>" <?php selected( $form[ 'id' ], $current_form, true ); ?>><?php echo esc_html( $form[ 'title' ] ); ?></option>
159 159
 				<?php } ?>
160 160
 			</select>
161 161
 		<?php }
@@ -164,26 +164,26 @@  discard block
 block discarded – undo
164 164
 		$current_layout = \GV\Utils::_GET( 'gravityview_layout' );
165 165
 
166 166
 		// If there are no forms to select, show no forms.
167
-		if( ! empty( $layouts ) ) { ?>
167
+		if ( ! empty( $layouts ) ) { ?>
168 168
 			<label for="gravityview_layout_name" class="screen-reader-text"><?php esc_html_e( 'Filter Views by layout', 'gravityview' ); ?></label>
169 169
 			<select name="gravityview_layout" id="gravityview_layout_name">
170 170
 				<option value="" <?php selected( '', $current_layout, true ); ?>><?php esc_html_e( 'All layouts', 'gravityview' ); ?></option>
171 171
 				<optgroup label="<?php esc_html_e( 'Layouts', 'gravityview' ); ?>">
172
-				<?php foreach( $layouts as $layout_id => $layout ) {
173
-					if ( in_array( $layout['type'], array( 'preset', 'internal' ), true ) ) {
172
+				<?php foreach ( $layouts as $layout_id => $layout ) {
173
+					if ( in_array( $layout[ 'type' ], array( 'preset', 'internal' ), true ) ) {
174 174
 						continue;
175 175
 					}
176 176
 					?>
177
-					<option value="<?php echo esc_attr( $layout_id ); ?>" <?php selected( $layout_id, $current_layout, true ); ?>><?php echo esc_html( $layout['label'] ); ?></option>
177
+					<option value="<?php echo esc_attr( $layout_id ); ?>" <?php selected( $layout_id, $current_layout, true ); ?>><?php echo esc_html( $layout[ 'label' ] ); ?></option>
178 178
 				<?php } ?>
179 179
 				</optgroup>
180 180
 				<optgroup label="<?php esc_html_e( 'Form Presets', 'gravityview' ); ?>">
181
-				<?php foreach( $layouts as $layout_id => $layout ) {
182
-					if ( ! in_array( $layout['type'], array( 'preset' ), true ) ) {
181
+				<?php foreach ( $layouts as $layout_id => $layout ) {
182
+					if ( ! in_array( $layout[ 'type' ], array( 'preset' ), true ) ) {
183 183
 						continue;
184 184
 					}
185 185
 					?>
186
-					<option value="<?php echo esc_attr( $layout_id ); ?>" <?php selected( $layout_id, $current_layout, true ); ?>><?php echo esc_html( $layout['label'] ); ?></option>
186
+					<option value="<?php echo esc_attr( $layout_id ); ?>" <?php selected( $layout_id, $current_layout, true ); ?>><?php echo esc_html( $layout[ 'label' ] ); ?></option>
187 187
 				<?php } ?>
188 188
 				</optgroup>
189 189
 			</select>
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 */
198 198
 	public static function render_setting_row( $key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s' ) {
199 199
 		_deprecated_function( 'GravityView_Admin_Views::render_setting_row', '1.1.7', 'GravityView_Render_Settings::render_setting_row' );
200
-		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name , $id );
200
+		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name, $id );
201 201
 	}
202 202
 
203 203
 	/**
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
 
228 228
 		$priority = 0;
229 229
 
230
-		if( 'form_list' === GFForms::get_page() ) {
230
+		if ( 'form_list' === GFForms::get_page() ) {
231 231
 			$priority = 790;
232 232
         }
233 233
 
234
-		if( empty( $connected_views ) ) {
234
+		if ( empty( $connected_views ) ) {
235 235
 
236
-		    $menu_items['gravityview'] = array(
236
+		    $menu_items[ 'gravityview' ] = array(
237 237
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
238 238
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>', // Only appears in GF pre-2.5
239 239
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -249,23 +249,23 @@  discard block
 block discarded – undo
249 249
 		$sub_menu_items = array();
250 250
 		foreach ( (array)$connected_views as $view ) {
251 251
 
252
-			if( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
252
+			if ( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
253 253
 				continue;
254 254
 			}
255 255
 
256
-			$label = empty( $view->post_title ) ? sprintf( __('No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
256
+			$label = empty( $view->post_title ) ? sprintf( __( 'No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
257 257
 
258
-			$sub_menu_items[] = array(
258
+			$sub_menu_items[ ] = array(
259 259
 				'label' => esc_attr( $label ),
260
-				'url' => admin_url( 'post.php?action=edit&post='.$view->ID ),
260
+				'url' => admin_url( 'post.php?action=edit&post=' . $view->ID ),
261 261
 				'icon' => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
262 262
 			);
263 263
 		}
264 264
 
265 265
 		// If there were no items added, then let's create the parent menu
266
-		if( $sub_menu_items ) {
266
+		if ( $sub_menu_items ) {
267 267
 
268
-		    $sub_menu_items[] = array(
268
+		    $sub_menu_items[ ] = array(
269 269
 			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
270 270
 			    'icon' => '<span class="dashicons dashicons-plus"></span>',
271 271
 			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -274,14 +274,14 @@  discard block
 block discarded – undo
274 274
             );
275 275
 
276 276
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
277
-			$sub_menu_items[] = array(
277
+			$sub_menu_items[ ] = array(
278 278
 				'url' => '#',
279 279
 				'label' => '',
280 280
 				'menu_class' => 'hidden',
281 281
 				'capabilities' => '',
282 282
 			);
283 283
 
284
-			$menu_items['gravityview'] = array(
284
+			$menu_items[ 'gravityview' ] = array(
285 285
 				'label'          => __( 'Connected Views', 'gravityview' ),
286 286
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
287 287
 				'title'          => __( 'GravityView Views using this form as a data source', 'gravityview' ),
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 		$add = array( 'captcha', 'page' );
310 310
 
311 311
 		// Don't allowing editing the following values:
312
-		if( $context === 'edit' ) {
313
-			$add[] = 'post_id';
312
+		if ( $context === 'edit' ) {
313
+			$add[ ] = 'post_id';
314 314
 		}
315 315
 
316 316
 		$return = array_merge( $array, $add );
@@ -333,27 +333,27 @@  discard block
 block discarded – undo
333 333
 		foreach ( $default_args as $key => $arg ) {
334 334
 
335 335
 			// If an arg has `tooltip` defined, but it's false, don't display a tooltip
336
-			if( isset( $arg['tooltip'] ) && empty( $arg['tooltip'] ) ) { continue; }
336
+			if ( isset( $arg[ 'tooltip' ] ) && empty( $arg[ 'tooltip' ] ) ) { continue; }
337 337
 
338 338
 			// By default, use `tooltip` if defined.
339
-			$tooltip = empty( $arg['tooltip'] ) ? NULL : $arg['tooltip'];
339
+			$tooltip = empty( $arg[ 'tooltip' ] ) ? NULL : $arg[ 'tooltip' ];
340 340
 
341 341
 			// If there's no tooltip set, continue
342
-			if( empty( $tooltip ) ) {
342
+			if ( empty( $tooltip ) ) {
343 343
 				continue;
344 344
 			}
345 345
 
346 346
 			// Add the tooltip
347
-			$gv_tooltips[ 'gv_'.$key ] = array(
348
-				'title'	=> $arg['label'],
347
+			$gv_tooltips[ 'gv_' . $key ] = array(
348
+				'title'	=> $arg[ 'label' ],
349 349
 				'value'	=> $tooltip,
350 350
 			);
351 351
 
352 352
 		}
353 353
 
354
-		$gv_tooltips['gv_css_merge_tags'] = array(
355
-			'title' => __('CSS Merge Tags', 'gravityview'),
356
-			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview'), '<code>', '</code>' )
354
+		$gv_tooltips[ 'gv_css_merge_tags' ] = array(
355
+			'title' => __( 'CSS Merge Tags', 'gravityview' ),
356
+			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview' ), '<code>', '</code>' )
357 357
 		);
358 358
 
359 359
 		/**
@@ -371,9 +371,9 @@  discard block
 block discarded – undo
371 371
 
372 372
 		foreach ( $gv_tooltips as $key => $tooltip ) {
373 373
 
374
-			$title = empty( $tooltip['title'] ) ? '' : '<h6>'.esc_html( $tooltip['title'] ) .'</h6>';
374
+			$title = empty( $tooltip[ 'title' ] ) ? '' : '<h6>' . esc_html( $tooltip[ 'title' ] ) . '</h6>';
375 375
 
376
-			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip['value'] ) );
376
+			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip[ 'value' ] ) );
377 377
 		}
378 378
 
379 379
 		return $tooltips;
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 	 *
388 388
 	 * @return void
389 389
 	 */
390
-	public function add_custom_column_content( $column_name = NULL, $post_id )	{
390
+	public function add_custom_column_content( $column_name = NULL, $post_id ) {
391 391
 
392 392
 		$output = '';
393 393
 
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 				// Generate backup if label doesn't exist: `example_name` => `Example Name`
410 410
 				$template_id_pretty = ucwords( implode( ' ', explode( '_', $template_id ) ) );
411 411
 
412
-				$output = $template ? $template['label'] : $template_id_pretty;
412
+				$output = $template ? $template[ 'label' ] : $template_id_pretty;
413 413
 
414 414
 				break;
415 415
 
@@ -450,12 +450,12 @@  discard block
 block discarded – undo
450 450
 	static public function get_connected_form_links( $form, $include_form_link = true ) {
451 451
 
452 452
 		// Either the form is empty or the form ID is 0, not yet set.
453
-		if( empty( $form ) ) {
453
+		if ( empty( $form ) ) {
454 454
 			return '';
455 455
 		}
456 456
 
457 457
 		// The $form is passed as the form ID
458
-		if( !is_array( $form ) ) {
458
+		if ( ! is_array( $form ) ) {
459 459
 			$form = gravityview_get_form( $form );
460 460
 		}
461 461
 
@@ -463,35 +463,35 @@  discard block
 block discarded – undo
463 463
 			return '';
464 464
 		}
465 465
 
466
-		$form_id = $form['id'];
466
+		$form_id = $form[ 'id' ];
467 467
 		$links = array();
468 468
 
469
-		if( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
469
+		if ( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
470 470
 			$form_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;id=%d', $form_id ) );
471
-			$form_link = '<strong class="gv-form-title">'.gravityview_get_link( $form_url, $form['title'], 'class=row-title' ).'</strong>';
472
-			$links[] = '<span>'.gravityview_get_link( $form_url, __('Edit Form', 'gravityview') ).'</span>';
471
+			$form_link = '<strong class="gv-form-title">' . gravityview_get_link( $form_url, $form[ 'title' ], 'class=row-title' ) . '</strong>';
472
+			$links[ ] = '<span>' . gravityview_get_link( $form_url, __( 'Edit Form', 'gravityview' ) ) . '</span>';
473 473
 		} else {
474
-			$form_link = '<strong class="gv-form-title">'. esc_html( $form['title'] ). '</strong>';
474
+			$form_link = '<strong class="gv-form-title">' . esc_html( $form[ 'title' ] ) . '</strong>';
475 475
 		}
476 476
 
477
-		if( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
477
+		if ( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
478 478
 			$entries_url = admin_url( sprintf( 'admin.php?page=gf_entries&amp;id=%d', $form_id ) );
479
-			$links[] = '<span>'.gravityview_get_link( $entries_url, __('Entries', 'gravityview') ).'</span>';
479
+			$links[ ] = '<span>' . gravityview_get_link( $entries_url, __( 'Entries', 'gravityview' ) ) . '</span>';
480 480
 		}
481 481
 
482
-		if( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
482
+		if ( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
483 483
 			$settings_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=%d', $form_id ) );
484
-			$links[] = '<span>'.gravityview_get_link( $settings_url, __('Settings', 'gravityview'), 'title='.__('Edit settings for this form', 'gravityview') ).'</span>';
484
+			$links[ ] = '<span>' . gravityview_get_link( $settings_url, __( 'Settings', 'gravityview' ), 'title=' . __( 'Edit settings for this form', 'gravityview' ) ) . '</span>';
485 485
 		}
486 486
 
487
-		if( GVCommon::has_cap( array("gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms") ) ) {
487
+		if ( GVCommon::has_cap( array( "gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms" ) ) ) {
488 488
 			$preview_url = site_url( sprintf( '?gf_page=preview&amp;id=%d', $form_id ) );
489
-			$links[] = '<span>'.gravityview_get_link( $preview_url, __('Preview Form', 'gravityview'), 'title='.__('Preview this form', 'gravityview') ).'</span>';
489
+			$links[ ] = '<span>' . gravityview_get_link( $preview_url, __( 'Preview Form', 'gravityview' ), 'title=' . __( 'Preview this form', 'gravityview' ) ) . '</span>';
490 490
 		}
491 491
 
492 492
 		$output = '';
493 493
 
494
-		if( !empty( $include_form_link ) ) {
494
+		if ( ! empty( $include_form_link ) ) {
495 495
 			$output .= $form_link;
496 496
 		}
497 497
 
@@ -506,11 +506,11 @@  discard block
 block discarded – undo
506 506
 		$css_class = 'row-actions';
507 507
 
508 508
 		// Is Screen Options > View mode set to "Extended view"? If so, keep actions visible.
509
-		if( 'excerpt' === get_user_setting( 'posts_list_mode', 'list' ) ) {
509
+		if ( 'excerpt' === get_user_setting( 'posts_list_mode', 'list' ) ) {
510 510
 			$css_class = 'row-actions visible';
511 511
 		}
512 512
 
513
-		$output .= '<div class="' . $css_class . '">'. implode( ' | ', $links ) .'</div>';
513
+		$output .= '<div class="' . $css_class . '">' . implode( ' | ', $links ) . '</div>';
514 514
 
515 515
 		return $output;
516 516
 	}
@@ -524,8 +524,8 @@  discard block
 block discarded – undo
524 524
 		// Get the date column and save it for later to add back in.
525 525
 		// This adds it after the Data Source column.
526 526
 		// This way, we don't need to do array_slice, array_merge, etc.
527
-		$date = $columns['date'];
528
-		unset( $columns['date'] );
527
+		$date = $columns[ 'date' ];
528
+		unset( $columns[ 'date' ] );
529 529
 
530 530
 		$data_source_required_caps = array(
531 531
 			'gravityforms_edit_forms',
@@ -536,14 +536,14 @@  discard block
 block discarded – undo
536 536
 			'gravityforms_preview_forms',
537 537
 		);
538 538
 
539
-		if( GVCommon::has_cap( $data_source_required_caps ) ) {
540
-			$columns['gv_connected_form'] = __( 'Data Source', 'gravityview' );
539
+		if ( GVCommon::has_cap( $data_source_required_caps ) ) {
540
+			$columns[ 'gv_connected_form' ] = __( 'Data Source', 'gravityview' );
541 541
 		}
542 542
 
543
-		$columns['gv_template'] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
543
+		$columns[ 'gv_template' ] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
544 544
 
545 545
 		// Add the date back in.
546
-		$columns['date'] = $date;
546
+		$columns[ 'date' ] = $date;
547 547
 
548 548
 		return $columns;
549 549
 	}
@@ -556,12 +556,12 @@  discard block
 block discarded – undo
556 556
 	 */
557 557
 	function save_postdata( $post_id ) {
558 558
 
559
-		if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){
559
+		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
560 560
 			return;
561 561
 		}
562 562
 
563 563
 		// validate post_type
564
-		if ( ! isset( $_POST['post_type'] ) || 'gravityview' != $_POST['post_type'] ) {
564
+		if ( ! isset( $_POST[ 'post_type' ] ) || 'gravityview' != $_POST[ 'post_type' ] ) {
565 565
 			return;
566 566
 		}
567 567
 
@@ -576,63 +576,63 @@  discard block
 block discarded – undo
576 576
 		$statii = array();
577 577
 
578 578
 		// check if this is a start fresh View
579
-		if ( isset( $_POST['gravityview_select_form_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_form_nonce'], 'gravityview_select_form' ) ) {
579
+		if ( isset( $_POST[ 'gravityview_select_form_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_form_nonce' ], 'gravityview_select_form' ) ) {
580 580
 
581
-			$form_id = !empty( $_POST['gravityview_form_id'] ) ? $_POST['gravityview_form_id'] : '';
581
+			$form_id = ! empty( $_POST[ 'gravityview_form_id' ] ) ? $_POST[ 'gravityview_form_id' ] : '';
582 582
 			// save form id
583
-			$statii['form_id'] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
583
+			$statii[ 'form_id' ] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
584 584
 
585 585
 		}
586 586
 
587
-		if( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii['form_id'] ) ) {
587
+		if ( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii[ 'form_id' ] ) ) {
588 588
 			gravityview()->log->error( 'Current user does not have the capability to create a new Form.', array( 'data' => wp_get_current_user() ) );
589 589
 			return;
590 590
 		}
591 591
 
592 592
 		// Was this a start fresh?
593
-		if ( ! empty( $_POST['gravityview_form_id_start_fresh'] ) ) {
594
-			$statii['start_fresh'] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
593
+		if ( ! empty( $_POST[ 'gravityview_form_id_start_fresh' ] ) ) {
594
+			$statii[ 'start_fresh' ] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
595 595
 		} else {
596
-			$statii['start_fresh'] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
596
+			$statii[ 'start_fresh' ] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
597 597
 		}
598 598
 
599 599
 		// Check if we have a template id
600
-		if ( isset( $_POST['gravityview_select_template_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_template_nonce'], 'gravityview_select_template' ) ) {
600
+		if ( isset( $_POST[ 'gravityview_select_template_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_template_nonce' ], 'gravityview_select_template' ) ) {
601 601
 
602
-			$template_id = !empty( $_POST['gravityview_directory_template'] ) ? $_POST['gravityview_directory_template'] : '';
602
+			$template_id = ! empty( $_POST[ 'gravityview_directory_template' ] ) ? $_POST[ 'gravityview_directory_template' ] : '';
603 603
 
604 604
 			// now save template id
605
-			$statii['directory_template'] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
605
+			$statii[ 'directory_template' ] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
606 606
 		}
607 607
 
608 608
 
609 609
 		// save View Configuration metabox
610
-		if ( isset( $_POST['gravityview_view_configuration_nonce'] ) && wp_verify_nonce( $_POST['gravityview_view_configuration_nonce'], 'gravityview_view_configuration' ) ) {
610
+		if ( isset( $_POST[ 'gravityview_view_configuration_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_view_configuration_nonce' ], 'gravityview_view_configuration' ) ) {
611 611
 
612 612
 			// template settings
613
-			if( empty( $_POST['template_settings'] ) ) {
614
-				$_POST['template_settings'] = array();
613
+			if ( empty( $_POST[ 'template_settings' ] ) ) {
614
+				$_POST[ 'template_settings' ] = array();
615 615
 			}
616
-			$statii['template_settings'] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST['template_settings'] );
616
+			$statii[ 'template_settings' ] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST[ 'template_settings' ] );
617 617
 
618 618
 			// guard against unloaded View configuration page
619
-			if ( isset( $_POST['gv_fields'] ) && isset( $_POST['gv_fields_done'] ) ) {
619
+			if ( isset( $_POST[ 'gv_fields' ] ) && isset( $_POST[ 'gv_fields_done' ] ) ) {
620 620
 				$fields = array();
621 621
 
622
-				if ( ! empty( $_POST['gv_fields'] ) ) {
622
+				if ( ! empty( $_POST[ 'gv_fields' ] ) ) {
623 623
 					$fields = _gravityview_process_posted_fields();
624 624
 				}
625 625
 
626 626
 				$fields = wp_slash( $fields );
627 627
 
628
-				$statii['directory_fields'] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
628
+				$statii[ 'directory_fields' ] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
629 629
 			}
630 630
 
631 631
 			// Directory Visible Widgets
632
-			if( empty( $_POST['widgets'] ) ) {
633
-				$_POST['widgets'] = array();
632
+			if ( empty( $_POST[ 'widgets' ] ) ) {
633
+				$_POST[ 'widgets' ] = array();
634 634
 			}
635
-			$statii['directory_widgets'] = gravityview_set_directory_widgets( $post_id, $_POST['widgets'] );
635
+			$statii[ 'directory_widgets' ] = gravityview_set_directory_widgets( $post_id, $_POST[ 'widgets' ] );
636 636
 
637 637
 		} // end save view configuration
638 638
 
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 		 * @param array $statii Array of statuses of the post meta saving processes. If saving worked, each key should be mapped to a value of the post ID (`directory_widgets` => `124`). If failed (or didn't change), the value will be false.
643 643
 		 * @since 1.17.2
644 644
 		 */
645
-		do_action('gravityview_view_saved', $post_id, $statii );
645
+		do_action( 'gravityview_view_saved', $post_id, $statii );
646 646
 
647 647
 		gravityview()->log->debug( '[save_postdata] Update Post Meta Statuses (also returns false if nothing changed)', array( 'data' => array_map( 'intval', $statii ) ) );
648 648
 	}
@@ -687,20 +687,20 @@  discard block
 block discarded – undo
687 687
 
688 688
 		$output = '';
689 689
 
690
-		if( !empty( $fields ) ) {
690
+		if ( ! empty( $fields ) ) {
691 691
 
692
-			foreach( $fields as $id => $details ) {
692
+			foreach ( $fields as $id => $details ) {
693 693
 
694
-				if( in_array( $details['type'], (array) $blacklist_field_types ) ) {
694
+				if ( in_array( $details[ 'type' ], (array)$blacklist_field_types ) ) {
695 695
 					continue;
696 696
 				}
697 697
 
698 698
 				// Edit mode only allows editing the parent fields, not single inputs.
699
-				if( $context === 'edit' && ! empty( $details['parent'] ) ) {
699
+				if ( $context === 'edit' && ! empty( $details[ 'parent' ] ) ) {
700 700
 					continue;
701 701
 				}
702 702
 
703
-				$output .= new GravityView_Admin_View_Field( $details['label'], $id, $details, array(), $form );
703
+				$output .= new GravityView_Admin_View_Field( $details[ 'label' ], $id, $details, array(), $form );
704 704
 
705 705
 			} // End foreach
706 706
 		}
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 		echo $output;
709 709
 
710 710
 		// For the EDIT view we only want to allow the form fields.
711
-		if( $context === 'edit' ) {
711
+		if ( $context === 'edit' ) {
712 712
 			return;
713 713
 		}
714 714
 
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 		$additional_fields = array(
728 728
 			array(
729 729
 				'label_text' => __( 'Add All Form Fields', 'gravityview' ),
730
-				'desc' => __('Insert all the form fields at once.', 'gravityview'),
730
+				'desc' => __( 'Insert all the form fields at once.', 'gravityview' ),
731 731
 				'field_id' => 'all-fields',
732 732
 				'label_type' => 'field',
733 733
 				'input_type' => null,
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 		 */
744 744
 		$additional_fields = apply_filters( 'gravityview_additional_fields', $additional_fields );
745 745
 
746
-		foreach ( (array) $additional_fields as $item ) {
746
+		foreach ( (array)$additional_fields as $item ) {
747 747
 
748 748
 			// Prevent items from not having index set
749 749
 			$item = wp_parse_args( $item, array(
@@ -754,16 +754,16 @@  discard block
 block discarded – undo
754 754
 				'field_options' => null,
755 755
 				'settings_html'	=> null,
756 756
 				'icon' => null,
757
-			));
757
+			) );
758 758
 
759 759
 			// Backward compat.
760
-			if( !empty( $item['field_options'] ) ) {
760
+			if ( ! empty( $item[ 'field_options' ] ) ) {
761 761
 				// Use settings_html from now on.
762
-				$item['settings_html'] = $item['field_options'];
762
+				$item[ 'settings_html' ] = $item[ 'field_options' ];
763 763
 			}
764 764
 
765 765
 			// Render a label for each of them
766
-			echo new GravityView_Admin_View_Field( $item['label_text'], $item['field_id'], $item, $settings = array(), $form );
766
+			echo new GravityView_Admin_View_Field( $item[ 'label_text' ], $item[ 'field_id' ], $item, $settings = array(), $form );
767 767
 
768 768
 		}
769 769
 
@@ -775,12 +775,12 @@  discard block
 block discarded – undo
775 775
 	 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
776 776
 	 * @return array
777 777
 	 */
778
-	function get_entry_default_fields($form, $zone) {
778
+	function get_entry_default_fields( $form, $zone ) {
779 779
 
780 780
 		$entry_default_fields = array();
781 781
 
782 782
 		// if in zone directory or single
783
-		if( in_array( $zone, array( 'directory', 'single' ), true ) ) {
783
+		if ( in_array( $zone, array( 'directory', 'single' ), true ) ) {
784 784
 
785 785
 			$meta_fields = GravityView_Fields::get_all( array( 'meta', 'gravityview', 'add-ons' ) );
786 786
 
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
 		 * @param  string|array $form form_ID or form object
798 798
 		 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
799 799
 		 */
800
-		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone);
800
+		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone );
801 801
 	}
802 802
 
803 803
 	/**
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 	 */
809 809
 	function get_available_fields( $form = '', $zone = NULL ) {
810 810
 
811
-		if( empty( $form ) ) {
811
+		if ( empty( $form ) ) {
812 812
 			gravityview()->log->error( '$form is empty' );
813 813
 			return array();
814 814
 		}
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 		$fields = gravityview_get_form_fields( $form, true );
818 818
 
819 819
 		// get meta fields ( only if form was already created )
820
-		if( !is_array( $form ) ) {
820
+		if ( ! is_array( $form ) ) {
821 821
 			$meta_fields = gravityview_get_entry_meta( $form );
822 822
 		} else {
823 823
 			$meta_fields = array();
@@ -830,8 +830,8 @@  discard block
 block discarded – undo
830 830
 		$fields = $fields + $meta_fields + $default_fields;
831 831
 
832 832
 		// Move Custom Content to top
833
-		if ( isset( $fields['custom'] ) ) {
834
-			$fields = array( 'custom' => $fields['custom'] ) + $fields;
833
+		if ( isset( $fields[ 'custom' ] ) ) {
834
+			$fields = array( 'custom' => $fields[ 'custom' ] ) + $fields;
835 835
 		}
836 836
 
837 837
 		$gv_fields = GravityView_Fields::get_all();
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 		foreach ( $fields as &$field ) {
840 840
 			foreach ( $gv_fields as $gv_field ) {
841 841
 				if ( \GV\Utils::get( $field, 'type' ) === $gv_field->name ) {
842
-					$field['icon'] = \GV\Utils::get( $gv_field, 'icon' );
842
+					$field[ 'icon' ] = \GV\Utils::get( $gv_field, 'icon' );
843 843
 				}
844 844
 			}
845 845
 		}
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 		}
868 868
 
869 869
 		foreach ( $widgets as $id => $details ) {
870
-			echo new GravityView_Admin_View_Widget( $details['label'], $id, $details );
870
+			echo new GravityView_Admin_View_Widget( $details[ 'label' ], $id, $details );
871 871
 		}
872 872
 
873 873
 	}
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 	function render_active_areas( $template_id, $type, $zone, $rows, $values ) {
898 898
 		global $post;
899 899
 
900
-		if( $type === 'widget' ) {
900
+		if ( $type === 'widget' ) {
901 901
 			$button_label = __( 'Add Widget', 'gravityview' );
902 902
 		} else {
903 903
 			$button_label = __( 'Add Field', 'gravityview' );
@@ -923,10 +923,10 @@  discard block
 block discarded – undo
923 923
 		$form_id = null;
924 924
 
925 925
 		// if saved values, get available fields to label everyone
926
-		if( !empty( $values ) && ( !empty( $post->ID ) || !empty( $_POST['template_id'] ) ) ) {
926
+		if ( ! empty( $values ) && ( ! empty( $post->ID ) || ! empty( $_POST[ 'template_id' ] ) ) ) {
927 927
 
928
-			if( !empty( $_POST['template_id'] ) ) {
929
-				$form = GravityView_Ajax::pre_get_form_fields( $_POST['template_id'] );
928
+			if ( ! empty( $_POST[ 'template_id' ] ) ) {
929
+				$form = GravityView_Ajax::pre_get_form_fields( $_POST[ 'template_id' ] );
930 930
 			} else {
931 931
 				$form_id = $form = gravityview_get_form_id( $post->ID );
932 932
 			}
@@ -944,53 +944,53 @@  discard block
 block discarded – undo
944 944
 			}
945 945
 		}
946 946
 
947
-		foreach( $rows as $row ) :
948
-			foreach( $row as $col => $areas ) :
949
-				$column = ($col == '2-2') ? '1-2' : $col; ?>
947
+		foreach ( $rows as $row ) :
948
+			foreach ( $row as $col => $areas ) :
949
+				$column = ( $col == '2-2' ) ? '1-2' : $col; ?>
950 950
 
951 951
 				<div class="gv-grid-col-<?php echo esc_attr( $column ); ?>">
952 952
 
953
-					<?php foreach( $areas as $area ) : 	?>
953
+					<?php foreach ( $areas as $area ) : 	?>
954 954
 
955
-						<div class="gv-droppable-area" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>">
956
-                            <p class="gv-droppable-area-title" <?php if ( 'widget' === $type && empty( $area['subtitle'] ) ) { echo ' style="margin: 0; padding: 0;"'; } ?>>
957
-								<strong <?php if ( 'widget' === $type ) { echo 'class="screen-reader-text"'; } ?>><?php echo esc_html( $area['title'] ); ?></strong>
955
+						<div class="gv-droppable-area" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>">
956
+                            <p class="gv-droppable-area-title" <?php if ( 'widget' === $type && empty( $area[ 'subtitle' ] ) ) { echo ' style="margin: 0; padding: 0;"'; } ?>>
957
+								<strong <?php if ( 'widget' === $type ) { echo 'class="screen-reader-text"'; } ?>><?php echo esc_html( $area[ 'title' ] ); ?></strong>
958 958
 
959 959
 								<?php if ( 'widget' !== $type ) { ?>
960
-									<a class="clear-all-fields alignright" role="button" href="#" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>"><?php esc_html_e( 'Clear all fields', 'gravityview' ); ?></a>
960
+									<a class="clear-all-fields alignright" role="button" href="#" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>"><?php esc_html_e( 'Clear all fields', 'gravityview' ); ?></a>
961 961
 								<?php } ?>
962 962
 
963
-                                <?php if ( ! empty( $area['subtitle'] ) ) { ?>
964
-									<span class="gv-droppable-area-subtitle"><span class="gf_tooltip gv_tooltip tooltip" title="<?php echo esc_attr( $area['subtitle'] ); ?>"></span></span>
963
+                                <?php if ( ! empty( $area[ 'subtitle' ] ) ) { ?>
964
+									<span class="gv-droppable-area-subtitle"><span class="gf_tooltip gv_tooltip tooltip" title="<?php echo esc_attr( $area[ 'subtitle' ] ); ?>"></span></span>
965 965
 								<?php } ?>
966 966
 							</p>
967 967
 							<div class="active-drop-container active-drop-container-<?php echo esc_attr( $type ); ?>">
968
-							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>"><?php // render saved fields
969
-								if( ! empty( $values[ $zone .'_'. $area['areaid'] ] ) ) {
968
+							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>"><?php // render saved fields
969
+								if ( ! empty( $values[ $zone . '_' . $area[ 'areaid' ] ] ) ) {
970 970
 
971
-									foreach( $values[ $zone .'_'. $area['areaid'] ] as $uniqid => $field ) {
971
+									foreach ( $values[ $zone . '_' . $area[ 'areaid' ] ] as $uniqid => $field ) {
972 972
 
973 973
 										// Maybe has a form ID
974
-										$form_id = empty( $field['form_id'] ) ? $form_id : $field['form_id'];
974
+										$form_id = empty( $field[ 'form_id' ] ) ? $form_id : $field[ 'form_id' ];
975 975
 
976 976
 										$input_type = NULL;
977 977
 
978 978
 										if ( $form_id ) {
979
-											$original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ;
979
+											$original_item = isset( $available_items[ $form_id ] [ $field[ 'id' ] ] ) ? $available_items[ $form_id ] [ $field[ 'id' ] ] : false;
980 980
                                         } else {
981
-											$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
981
+											$original_item = isset( $available_items[ $field[ 'id' ] ] ) ? $available_items[ $field[ 'id' ] ] : false;
982 982
                                         }
983 983
 
984
-										if ( !$original_item ) {
985
-											gravityview()->log->error( 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array(' data' => array('available_items' => $available_items, 'field' => $field ) ) );
984
+										if ( ! $original_item ) {
985
+											gravityview()->log->error( 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array( ' data' => array( 'available_items' => $available_items, 'field' => $field ) ) );
986 986
 
987 987
 											$original_item = $field;
988 988
 										} else {
989
-											$input_type = isset( $original_item['type'] ) ? $original_item['type'] : NULL;
989
+											$input_type = isset( $original_item[ 'type' ] ) ? $original_item[ 'type' ] : NULL;
990 990
 										}
991 991
 
992 992
 										// Field options dialog box
993
-										$field_options = GravityView_Render_Settings::render_field_options( $form_id, $type, $template_id, $field['id'], $original_item['label'], $zone .'_'. $area['areaid'], $input_type, $uniqid, $field, $zone, $original_item );
993
+										$field_options = GravityView_Render_Settings::render_field_options( $form_id, $type, $template_id, $field[ 'id' ], $original_item[ 'label' ], $zone . '_' . $area[ 'areaid' ], $input_type, $uniqid, $field, $zone, $original_item );
994 994
 
995 995
 										$item = array(
996 996
 											'input_type' => $input_type,
@@ -1003,12 +1003,12 @@  discard block
 block discarded – undo
1003 1003
 											$item = wp_parse_args( $item, $original_item );
1004 1004
 										}
1005 1005
 
1006
-										switch( $type ) {
1006
+										switch ( $type ) {
1007 1007
 											case 'widget':
1008
-												echo new GravityView_Admin_View_Widget( $item['label'], $field['id'], $item, $field );
1008
+												echo new GravityView_Admin_View_Widget( $item[ 'label' ], $field[ 'id' ], $item, $field );
1009 1009
 												break;
1010 1010
 											default:
1011
-												echo new GravityView_Admin_View_Field( $field['label'], $field['id'], $item, $field, $form_id );
1011
+												echo new GravityView_Admin_View_Field( $field[ 'label' ], $field[ 'id' ], $item, $field, $form_id );
1012 1012
 										}
1013 1013
 									}
1014 1014
 
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 								<div class="gv-droppable-area-action">
1017 1017
 									<a href="#" class="gv-add-field button button-link button-hero" title=""
1018 1018
 									   data-objecttype="<?php echo esc_attr( $type ); ?>"
1019
-									   data-areaid="<?php echo esc_attr( $zone . '_' . $area['areaid'] ); ?>"
1019
+									   data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>"
1020 1020
 									   data-context="<?php echo esc_attr( $zone ); ?>"
1021 1021
 									   data-formid="<?php echo $view ? esc_attr( $view->form ? $view->form->ID : '' ) : ''; ?>"><?php echo '<span class="dashicons dashicons-plus-alt"></span>' . esc_html( $button_label ); ?></a>
1022 1022
 								</div>
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
 				// This is a new View, prefill the widgets
1050 1050
 				$widgets = array(
1051 1051
 					'header_top' => array(
1052
-						substr( md5( microtime( true ) ), 0, 13 ) => array (
1052
+						substr( md5( microtime( true ) ), 0, 13 ) => array(
1053 1053
 							'id' => 'search_bar',
1054 1054
 							'label' => __( 'Search Bar', 'gravityview' ),
1055 1055
 							'search_layout' => 'horizontal',
@@ -1124,12 +1124,12 @@  discard block
 block discarded – undo
1124 1124
 		if ( $post ) {
1125 1125
 			$source_form_id = gravityview_get_form_id( $post->ID );
1126 1126
 			if ( $source_form_id ) {
1127
-				$form_ids[] = $source_form_id;
1127
+				$form_ids[ ] = $source_form_id;
1128 1128
 			}
1129 1129
 
1130 1130
 			$joined_forms = \GV\View::get_joined_forms( $post->ID );
1131 1131
 			foreach ( $joined_forms as $joined_form ) {
1132
-				$form_ids[] = $joined_form->ID;
1132
+				$form_ids[ ] = $joined_form->ID;
1133 1133
 			}
1134 1134
 		}
1135 1135
 		foreach ( array_unique( $form_ids ) as $form_id ) {
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 	 * @return string HTML of the active areas
1168 1168
 	 */
1169 1169
 	function render_directory_active_areas( $template_id = '', $context = 'single', $post_id = '', $echo = false ) {
1170
-		if( empty( $template_id ) ) {
1170
+		if ( empty( $template_id ) ) {
1171 1171
 			gravityview()->log->debug( '[render_directory_active_areas] {template_id} is empty', array( 'template_id' => $template_id ) );
1172 1172
 			return '';
1173 1173
 		}
@@ -1181,12 +1181,12 @@  discard block
 block discarded – undo
1181 1181
 		 */
1182 1182
 		$template_areas = apply_filters( 'gravityview_template_active_areas', array(), $template_id, $context );
1183 1183
 
1184
-		if( empty( $template_areas ) ) {
1184
+		if ( empty( $template_areas ) ) {
1185 1185
 
1186 1186
 			gravityview()->log->debug( '[render_directory_active_areas] No areas defined. Maybe template {template_id} is disabled.', array( 'data' => $template_id ) );
1187 1187
 			$output = '<div>';
1188
-			$output .= '<h2 class="description" style="font-size: 16px; margin:0">'. sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>'.$template_id.'</em>' ) .'</h2>';
1189
-			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">'.esc_html__('The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview').'</p>';
1188
+			$output .= '<h2 class="description" style="font-size: 16px; margin:0">' . sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>' . $template_id . '</em>' ) . '</h2>';
1189
+			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">' . esc_html__( 'The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview' ) . '</p>';
1190 1190
 			$output .= '</div>';
1191 1191
 		} else {
1192 1192
 
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 
1202 1202
 		}
1203 1203
 
1204
-		if( $echo ) {
1204
+		if ( $echo ) {
1205 1205
 			echo $output;
1206 1206
 		}
1207 1207
 
@@ -1229,18 +1229,18 @@  discard block
 block discarded – undo
1229 1229
 		}
1230 1230
 
1231 1231
 		// Add the GV font (with the Astronaut)
1232
-        wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version );
1232
+        wp_enqueue_style( 'gravityview_global', plugins_url( 'assets/css/admin-global.css', GRAVITYVIEW_FILE ), array(), \GV\Plugin::$version );
1233 1233
 		wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version );
1234 1234
 
1235
-		wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true );
1235
+		wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), \GV\Plugin::$version, true );
1236 1236
 
1237
-		if( GFForms::get_page() === 'form_list' ) {
1237
+		if ( GFForms::get_page() === 'form_list' ) {
1238 1238
 			wp_enqueue_style( 'gravityview_views_styles' );
1239 1239
 			return;
1240 1240
         }
1241 1241
 
1242 1242
 		// Don't process any scripts below here if it's not a GravityView page.
1243
-		if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) {
1243
+		if ( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) {
1244 1244
 		    return;
1245 1245
 		}
1246 1246
 
@@ -1248,15 +1248,15 @@  discard block
 block discarded – undo
1248 1248
 
1249 1249
         wp_enqueue_script( 'jquery-ui-datepicker' );
1250 1250
 
1251
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version );
1251
+        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url( 'assets/css/admin-datepicker.css', GRAVITYVIEW_FILE ), \GV\Plugin::$version );
1252 1252
 
1253 1253
         // Enqueue scripts
1254 1254
         wp_enqueue_script( 'gravityview_views_scripts', plugins_url( 'assets/js/admin-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery-ui-tabs', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-ui-tooltip', 'jquery-ui-dialog', 'gravityview-jquery-cookie', 'jquery-ui-datepicker', 'underscore' ), \GV\Plugin::$version );
1255 1255
 
1256
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1256
+        wp_localize_script( 'gravityview_views_scripts', 'gvGlobals', array(
1257 1257
             'cookiepath' => COOKIEPATH,
1258 1258
             'admin_cookiepath' => ADMIN_COOKIE_PATH,
1259
-            'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1259
+            'passed_form_id' => (bool)\GV\Utils::_GET( 'form_id' ),
1260 1260
             'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1261 1261
             'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1262 1262
             'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ),
@@ -1271,7 +1271,7 @@  discard block
 block discarded – undo
1271 1271
             'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1272 1272
             'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1273 1273
             'remove_all_fields' => __( 'Would you like to remove all fields in this zone?', 'gravityview' ),
1274
-        ));
1274
+        ) );
1275 1275
 
1276 1276
 		wp_enqueue_style( 'gravityview_views_styles' );
1277 1277
 
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
         self::enqueue_gravity_forms_scripts();
1280 1280
 
1281 1281
 		// 2.5 changed how Merge Tags are enqueued
1282
-		if ( is_callable( array( 'GFCommon', 'output_hooks_javascript') ) ) {
1282
+		if ( is_callable( array( 'GFCommon', 'output_hooks_javascript' ) ) ) {
1283 1283
 			GFCommon::output_hooks_javascript();
1284 1284
 		}
1285 1285
 	}
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
 		);
1304 1304
 
1305 1305
 		if ( wp_is_mobile() ) {
1306
-		    $scripts[] = 'jquery-touch-punch';
1306
+		    $scripts[ ] = 'jquery-touch-punch';
1307 1307
 		}
1308 1308
 
1309 1309
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.
future/includes/class-gv-core.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,14 +114,14 @@
 block discarded – undo
114 114
 		/** Require critical legacy core files. @todo Deprecate */
115 115
 		require_once $this->plugin->dir( 'includes/import-functions.php' );
116 116
 		require_once $this->plugin->dir( 'includes/helper-functions.php' );
117
-		require_once $this->plugin->dir( 'includes/class-common.php');
118
-		require_once $this->plugin->dir( 'includes/connector-functions.php');
117
+		require_once $this->plugin->dir( 'includes/class-common.php' );
118
+		require_once $this->plugin->dir( 'includes/connector-functions.php' );
119 119
 		require_once $this->plugin->dir( 'includes/class-gravityview-compatibility.php' );
120 120
 		require_once $this->plugin->dir( 'includes/class-gravityview-roles-capabilities.php' );
121 121
 		require_once $this->plugin->dir( 'includes/class-gravityview-admin-notices.php' );
122 122
 		require_once $this->plugin->dir( 'includes/class-admin.php' );
123
-		require_once $this->plugin->dir( 'includes/class-post-types.php');
124
-		require_once $this->plugin->dir( 'includes/class-cache.php');
123
+		require_once $this->plugin->dir( 'includes/class-post-types.php' );
124
+		require_once $this->plugin->dir( 'includes/class-cache.php' );
125 125
 
126 126
 		/**
127 127
 		 * GravityView extensions and widgets.
Please login to merge, or discard this patch.
includes/import-functions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
  */
47 47
 function gravityview_import_helper_fix_line_breaks( $postmeta = array(), $post_id = 0, $post = array() ) {
48 48
 
49
-	if ( empty( $post['postmeta'] ) ) {
49
+	if ( empty( $post[ 'postmeta' ] ) ) {
50 50
 		return $postmeta;
51 51
 	}
52 52
 
53
-	if ( 'gravityview' !== $post['post_type'] ) {
53
+	if ( 'gravityview' !== $post[ 'post_type' ] ) {
54 54
 		return $postmeta;
55 55
 	}
56 56
 
@@ -62,27 +62,27 @@  discard block
 block discarded – undo
62 62
 	$performed_fix = false;
63 63
 
64 64
 	foreach ( $postmeta as &$meta ) {
65
-		$key = $meta['key'];
65
+		$key = $meta[ 'key' ];
66 66
 
67 67
 		if ( ! in_array( $key, $keys_to_fix, true ) ) {
68 68
 			continue;
69 69
 		}
70 70
 
71
-		$is_valid_serialized_data = maybe_unserialize( $meta['value'] );
71
+		$is_valid_serialized_data = maybe_unserialize( $meta[ 'value' ] );
72 72
 
73 73
 		// The values are not corrupted serialized data. No need to fix.
74 74
 		if ( false !== $is_valid_serialized_data ) {
75 75
 			continue;
76 76
 		}
77 77
 
78
-		$meta['value'] = str_replace( "\n", "\n\n", $meta['value'] );
78
+		$meta[ 'value' ] = str_replace( "\n", "\n\n", $meta[ 'value' ] );
79 79
 
80 80
 		$performed_fix = true;
81 81
 	}
82 82
 
83 83
 	// Leave a note that this modification has been done. We'll use it later.
84 84
 	if ( $performed_fix ) {
85
-		$postmeta[] = array(
85
+		$postmeta[ ] = array(
86 86
 			'key'   => '_gravityview_fixed_import_serialization',
87 87
 			'value' => 1,
88 88
 		);
Please login to merge, or discard this patch.
trustedlogin/psr/log/Psr/Log/AbstractLogger.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @return void
27 27
      */
28
-    public function emergency($message, array $context = array())
28
+    public function emergency( $message, array $context = array() )
29 29
     {
30
-        $this->log(LogLevel::EMERGENCY, $message, $context);
30
+        $this->log( LogLevel::EMERGENCY, $message, $context );
31 31
     }
32 32
 
33 33
     /**
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
      *
42 42
      * @return void
43 43
      */
44
-    public function alert($message, array $context = array())
44
+    public function alert( $message, array $context = array() )
45 45
     {
46
-        $this->log(LogLevel::ALERT, $message, $context);
46
+        $this->log( LogLevel::ALERT, $message, $context );
47 47
     }
48 48
 
49 49
     /**
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      *
57 57
      * @return void
58 58
      */
59
-    public function critical($message, array $context = array())
59
+    public function critical( $message, array $context = array() )
60 60
     {
61
-        $this->log(LogLevel::CRITICAL, $message, $context);
61
+        $this->log( LogLevel::CRITICAL, $message, $context );
62 62
     }
63 63
 
64 64
     /**
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      *
71 71
      * @return void
72 72
      */
73
-    public function error($message, array $context = array())
73
+    public function error( $message, array $context = array() )
74 74
     {
75
-        $this->log(LogLevel::ERROR, $message, $context);
75
+        $this->log( LogLevel::ERROR, $message, $context );
76 76
     }
77 77
 
78 78
     /**
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
      *
87 87
      * @return void
88 88
      */
89
-    public function warning($message, array $context = array())
89
+    public function warning( $message, array $context = array() )
90 90
     {
91
-        $this->log(LogLevel::WARNING, $message, $context);
91
+        $this->log( LogLevel::WARNING, $message, $context );
92 92
     }
93 93
 
94 94
     /**
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
      *
100 100
      * @return void
101 101
      */
102
-    public function notice($message, array $context = array())
102
+    public function notice( $message, array $context = array() )
103 103
     {
104
-        $this->log(LogLevel::NOTICE, $message, $context);
104
+        $this->log( LogLevel::NOTICE, $message, $context );
105 105
     }
106 106
 
107 107
     /**
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
      *
115 115
      * @return void
116 116
      */
117
-    public function info($message, array $context = array())
117
+    public function info( $message, array $context = array() )
118 118
     {
119
-        $this->log(LogLevel::INFO, $message, $context);
119
+        $this->log( LogLevel::INFO, $message, $context );
120 120
     }
121 121
 
122 122
     /**
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
      *
128 128
      * @return void
129 129
      */
130
-    public function debug($message, array $context = array())
130
+    public function debug( $message, array $context = array() )
131 131
     {
132
-        $this->log(LogLevel::DEBUG, $message, $context);
132
+        $this->log( LogLevel::DEBUG, $message, $context );
133 133
     }
134 134
 }
Please login to merge, or discard this patch.