Completed
Push — develop ( 316159...00443b )
by Zack
20:22
created
future/includes/class-gv-settings-view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 		if ( ! $detailed ) {
556 556
 			$defaults = array();
557 557
 			foreach ( $default_settings as $key => $value ) {
558
-				$defaults[ $key ] = $value['value'];
558
+				$defaults[ $key ] = $value[ 'value' ];
559 559
 			}
560 560
 			return $defaults;
561 561
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 				// If the $group argument is set for the method,
567 567
 				// ignore any settings that aren't in that group.
568 568
 				if ( ! empty( $group ) && is_string( $group ) ) {
569
-					if ( empty( $value['group'] ) || $value['group'] !== $group ) {
569
+					if ( empty( $value[ 'group' ] ) || $value[ 'group' ] !== $group ) {
570 570
 						unset( $default_settings[ $key ] );
571 571
 					}
572 572
 				}
Please login to merge, or discard this patch.
future/includes/class-gv-plugin.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 			return;
305 305
 		}
306 306
 
307
-		$locale = apply_filters( 'plugin_locale', ( ( function_exists('get_user_locale') && is_admin() ) ? get_user_locale() : get_locale() ), 'gravityview' );
307
+		$locale = apply_filters( 'plugin_locale', ( ( function_exists( 'get_user_locale' ) && is_admin() ) ? get_user_locale() : get_locale() ), 'gravityview' );
308 308
 
309 309
 		gravityview()->log->error( sprintf( 'Unable to load textdomain for %s locale.', $locale ) );
310 310
 	}
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
 	 */
527 527
 	private function get_php_version() {
528 528
 
529
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] ) ?
530
-			$GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] : phpversion();
529
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] ) ?
530
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] : phpversion();
531 531
 	}
532 532
 
533 533
 	/**
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
 	 */
540 540
 	private function get_wordpress_version() {
541 541
 
542
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] ) ?
543
-			$GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] : $GLOBALS['wp_version'];
542
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] ) ?
543
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] : $GLOBALS[ 'wp_version' ];
544 544
 	}
545 545
 
546 546
 	/**
@@ -552,14 +552,14 @@  discard block
 block discarded – undo
552 552
 	 */
553 553
 	private function get_gravityforms_version() {
554 554
 
555
-		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) {
555
+		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE' ] ) ) {
556 556
 			gravityview()->log->error( 'Gravity Forms is inactive or not installed.' );
557 557
 
558 558
 			return null;
559 559
 		}
560 560
 
561
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ?
562
-			$GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version;
561
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] ) ?
562
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] : \GFCommon::$version;
563 563
 	}
564 564
 
565 565
 	/**
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 		$items = get_posts( array(
606 606
 			'post_type'   => 'gravityview',
607 607
 			'post_status' => 'any',
608
-			'numberposts' => - 1,
608
+			'numberposts' => -1,
609 609
 			'fields'      => 'ids',
610 610
 		) );
611 611
 
@@ -619,9 +619,9 @@  discard block
 block discarded – undo
619 619
 		$tables = array();
620 620
 
621 621
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) ) {
622
-			$tables [] = \GFFormsModel::get_entry_meta_table_name();
622
+			$tables [ ] = \GFFormsModel::get_entry_meta_table_name();
623 623
 		} elseif ( ! $this->is_GF_25() ) {
624
-			$tables [] = \GFFormsModel::get_lead_meta_table_name();
624
+			$tables [ ] = \GFFormsModel::get_lead_meta_table_name();
625 625
 		}
626 626
 
627 627
 		foreach ( $tables as $meta_table ) {
@@ -640,9 +640,9 @@  discard block
 block discarded – undo
640 640
 		$tables = array();
641 641
 
642 642
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) {
643
-			$tables[] = \GFFormsModel::get_entry_notes_table_name();
643
+			$tables[ ] = \GFFormsModel::get_entry_notes_table_name();
644 644
 		} elseif ( ! $this->is_GF_25() ) {
645
-			$tables[] = \GFFormsModel::get_lead_notes_table_name();
645
+			$tables[ ] = \GFFormsModel::get_lead_notes_table_name();
646 646
 		}
647 647
 
648 648
 		$disapproved = __( 'Disapproved the Entry for GravityView', 'gravityview' );
Please login to merge, or discard this patch.
includes/admin/class-gravityview-support-port.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function maybe_add_article_to_tooltip( $tooltip = '', $article = array(), $url = '', $atts = '', $css_class = '', $anchor_text = '' ) {
55 55
 
56
-		if ( empty( $article['id'] ) ) {
56
+		if ( empty( $article[ 'id' ] ) ) {
57 57
 			return $tooltip;
58 58
 		}
59 59
 
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 
70 70
 		$css_class .= ' gv_tooltip';
71 71
 
72
-		if ( ! empty( $article['type'] ) ) {
73
-			$atts = sprintf( 'data-beacon-article-%s="%s"', $article['type'], $article['id'] );
72
+		if ( ! empty( $article[ 'type' ] ) ) {
73
+			$atts = sprintf( 'data-beacon-article-%s="%s"', $article[ 'type' ], $article[ 'id' ] );
74 74
 		} else {
75
-			$atts = sprintf( 'data-beacon-article="%s"', $article['id'] );
75
+			$atts = sprintf( 'data-beacon-article="%s"', $article[ 'id' ] );
76 76
 		}
77 77
 
78 78
 		$url = \GV\Utils::get( $article, 'url', '#' );
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
 		) );
173 173
 
174 174
 		// This is just HTML we don't need.
175
-		unset( $response['message'] );
175
+		unset( $response[ 'message' ] );
176 176
 
177
-		switch ( intval( $response['price_id'] ) ) {
177
+		switch ( intval( $response[ 'price_id' ] ) ) {
178 178
 			default:
179 179
 			case 1:
180 180
 				$package = 'Core';
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
 			'signature'             => hash_hmac( 'sha256', $current_user->user_email, self::beacon_key ),
203 203
 			'affiliate_id'          => gravityview()->plugin->settings->get( 'affiliate_id' ),
204 204
 			'is_super_admin'        => is_super_admin(),
205
-			'license_key'           => $response['license_key'] . ' (' . ucwords( $response['license'] ) . ')',
205
+			'license_key'           => $response[ 'license_key' ] . ' (' . ucwords( $response[ 'license' ] ) . ')',
206 206
 			'license_level'         => $package,
207 207
 			'alt_emails'            => sprintf( 'Admin: %s, GV Support: %s', get_bloginfo( 'admin_email' ), gravityview()->plugin->settings->get( 'support-email' ) ),
208
-			'payment_details'       => $response['customer_name'] . ' ' . $response['customer_email'],
208
+			'payment_details'       => $response[ 'customer_name' ] . ' ' . $response[ 'customer_email' ],
209 209
 			'wordpress_version'     => get_bloginfo( 'version', 'display' ),
210
-			'php_version'           => phpversion() . ' on ' . esc_html( $_SERVER['SERVER_SOFTWARE'] ),
210
+			'php_version'           => phpversion() . ' on ' . esc_html( $_SERVER[ 'SERVER_SOFTWARE' ] ),
211 211
 			'no_conflict_mode'      => empty( $no_conflict_mode ) ? 'Disabled' : 'Enabled',
212 212
 			'gravityview_version'   => \GV\Plugin::$version,
213 213
 			'gravity_forms_version' => GFForms::$version,
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		ob_get_clean();
218 218
 
219 219
 		// Help Scout length limit is 200 characters
220
-		foreach( $data as $key => $value ) {
220
+		foreach ( $data as $key => $value ) {
221 221
 			if ( ! is_string( $value ) ) {
222 222
                 continue;
223 223
 			}
Please login to merge, or discard this patch.
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/extensions/edit-entry/partials/form-buttons.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -44,35 +44,35 @@  discard block
 block discarded – undo
44 44
 
45 45
 	if ( $object->show_previous_button ) {
46 46
 		$previous_tabindex = GFCommon::get_tabindex();
47
-		$previous_label = GFCommon::replace_variables( $labels['previous'], $object->form, $object->entry );
47
+		$previous_label = GFCommon::replace_variables( $labels[ 'previous' ], $object->form, $object->entry );
48 48
 		?>
49
-		<input id="gform_previous_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $previous_label ); ?>" name="save" />
49
+		<input id="gform_previous_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $previous_label ); ?>" name="save" />
50 50
 		<?php
51 51
 	}
52 52
 
53 53
 	if ( $object->show_next_button ) {
54
-		$next_tabindex    = GFCommon::get_tabindex();
55
-		$next_label = GFCommon::replace_variables( $labels['next'], $object->form, $object->entry );
54
+		$next_tabindex = GFCommon::get_tabindex();
55
+		$next_label = GFCommon::replace_variables( $labels[ 'next' ], $object->form, $object->entry );
56 56
 		?>
57
-		<input id="gform_next_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $next_label ); ?>" name="save" />
57
+		<input id="gform_next_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $next_label ); ?>" name="save" />
58 58
 		<?php
59 59
 	}
60 60
 
61 61
 	if ( $object->show_update_button ) {
62
-		$update_tabindex  = GFCommon::get_tabindex();
63
-		$update_label = GFCommon::replace_variables( $labels['submit'], $object->form, $object->entry );
62
+		$update_tabindex = GFCommon::get_tabindex();
63
+		$update_label = GFCommon::replace_variables( $labels[ 'submit' ], $object->form, $object->entry );
64 64
 		?>
65
-		<input id="gform_submit_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $update_label ); ?>" name="save" />
65
+		<input id="gform_submit_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $update_label ); ?>" name="save" />
66 66
 		<?php
67 67
 	}
68 68
 
69
-	$cancel_tabindex   = GFCommon::get_tabindex();
70
-	$cancel_label = GFCommon::replace_variables( $labels['cancel'], $object->form, $object->entry );
69
+	$cancel_tabindex = GFCommon::get_tabindex();
70
+	$cancel_label = GFCommon::replace_variables( $labels[ 'cancel' ], $object->form, $object->entry );
71 71
 
72 72
 	// If the entry has been edited, history.back() will keep pointing to the Edit Entry screen. Go back before editing, please!
73 73
 	// On first visit, will be history.go(-1) because (0 + 1 * -1).
74 74
 	// After updating twice, history.go(-3) because (2 + 1 * -1)
75
-	$update_count = (int) \GV\Utils::_POST( 'update_count', 0 );
75
+	$update_count = (int)\GV\Utils::_POST( 'update_count', 0 );
76 76
 	$cancel_onclick = 'history.go(' . ( $update_count + 1 ) * -1 . '); return false;';
77 77
 	?>
78 78
 	<a class="btn btn-sm button button-small gv-button-cancel" onclick="<?php echo esc_attr( $cancel_onclick ); ?>" <?php echo $cancel_tabindex; ?> href="<?php echo esc_url( $back_link ); ?>"><?php echo esc_attr( $cancel_label ); ?></a>
@@ -94,5 +94,5 @@  discard block
 block discarded – undo
94 94
 	?>
95 95
 	<input type='hidden' name='update_count' value='<?php echo $update_count + 1; ?>'/>
96 96
 	<input type="hidden" name="action" value="update" />
97
-	<input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry['id'] ); ?>" />
97
+	<input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry[ 'id' ] ); ?>" />
98 98
 </div>
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/extensions/edit-entry/class-edit-entry-render.php 1 patch
Spacing   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	function load() {
136 136
 
137 137
 		/** @define "GRAVITYVIEW_DIR" "../../../" */
138
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' );
138
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' );
139 139
 
140 140
 		// Don't display an embedded form when editing an entry
141 141
 		add_action( 'wp_head', array( $this, 'prevent_render_form' ) );
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		add_action( 'wp', array( $this, 'prevent_maybe_process_form' ), 8 );
146 146
 		add_action( 'admin_init', array( $this, 'prevent_maybe_process_form' ), 8 );
147 147
 
148
-		add_filter( 'gravityview_is_edit_entry', array( $this, 'is_edit_entry') );
148
+		add_filter( 'gravityview_is_edit_entry', array( $this, 'is_edit_entry' ) );
149 149
 
150 150
 		add_action( 'gravityview_edit_entry', array( $this, 'init' ), 10, 4 );
151 151
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		add_filter( 'gform_plupload_settings', array( $this, 'modify_fileupload_settings' ), 10, 3 );
157 157
 
158 158
 		// Add fields expected by GFFormDisplay::validate()
159
-		add_filter( 'gform_pre_validation', array( $this, 'gform_pre_validation') );
159
+		add_filter( 'gform_pre_validation', array( $this, 'gform_pre_validation' ) );
160 160
 
161 161
 		// Fix multiselect value for GF 2.2
162 162
 		add_filter( 'gravityview/edit_entry/field_value_multiselect', array( $this, 'fix_multiselect_value_serialization' ), 10, 3 );
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	 * @return void
174 174
 	 */
175 175
 	public function prevent_render_form() {
176
-		if( $this->is_edit_entry() ) {
177
-			if( 'wp_head' === current_filter() ) {
176
+		if ( $this->is_edit_entry() ) {
177
+			if ( 'wp_head' === current_filter() ) {
178 178
 				add_filter( 'gform_shortcode_form', '__return_empty_string' );
179 179
 			} else {
180 180
 				remove_filter( 'gform_shortcode_form', '__return_empty_string' );
@@ -189,17 +189,17 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	public function prevent_maybe_process_form() {
191 191
 
192
-	    if( ! $this->is_edit_entry_submission() ) {
192
+	    if ( ! $this->is_edit_entry_submission() ) {
193 193
 			return;
194 194
 		}
195 195
 
196 196
 		gravityview()->log->debug( 'GravityView_Edit_Entry[prevent_maybe_process_form] Removing GFForms::maybe_process_form() action.' );
197 197
 
198
-		remove_action( 'wp',  array( 'RGForms', 'maybe_process_form'), 9 );
199
-		remove_action( 'wp',  array( 'GFForms', 'maybe_process_form'), 9 );
198
+		remove_action( 'wp', array( 'RGForms', 'maybe_process_form' ), 9 );
199
+		remove_action( 'wp', array( 'GFForms', 'maybe_process_form' ), 9 );
200 200
 
201
-		remove_action( 'admin_init',  array( 'GFForms', 'maybe_process_form'), 9 );
202
-		remove_action( 'admin_init',  array( 'RGForms', 'maybe_process_form'), 9 );
201
+		remove_action( 'admin_init', array( 'GFForms', 'maybe_process_form' ), 9 );
202
+		remove_action( 'admin_init', array( 'RGForms', 'maybe_process_form' ), 9 );
203 203
 	}
204 204
 
205 205
 	/**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 
211 211
 		$is_edit_entry =
212 212
 			( GravityView_frontend::is_single_entry() || gravityview()->request->is_entry() )
213
-			&& ( ! empty( $_GET['edit'] ) );
213
+			&& ( ! empty( $_GET[ 'edit' ] ) );
214 214
 
215 215
 		return ( $is_edit_entry || $this->is_edit_entry_submission() );
216 216
 	}
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 * @return boolean
222 222
 	 */
223 223
 	public function is_edit_entry_submission() {
224
-		return !empty( $_POST[ self::$nonce_field ] );
224
+		return ! empty( $_POST[ self::$nonce_field ] );
225 225
 	}
226 226
 
227 227
 	/**
@@ -234,16 +234,16 @@  discard block
 block discarded – undo
234 234
 
235 235
 
236 236
 		$entries = $gravityview_view->getEntries();
237
-	    self::$original_entry = $entries[0];
238
-	    $this->entry = $entries[0];
237
+	    self::$original_entry = $entries[ 0 ];
238
+	    $this->entry = $entries[ 0 ];
239 239
 
240
-		self::$original_form = GFAPI::get_form( $this->entry['form_id'] );
240
+		self::$original_form = GFAPI::get_form( $this->entry[ 'form_id' ] );
241 241
 		$this->form = $gravityview_view->getForm();
242
-		$this->form_id = $this->entry['form_id'];
242
+		$this->form_id = $this->entry[ 'form_id' ];
243 243
 		$this->view_id = $gravityview_view->getViewId();
244 244
 		$this->post_id = \GV\Utils::get( $post, 'ID', null );
245 245
 
246
-		self::$nonce_key = GravityView_Edit_Entry::get_nonce_key( $this->view_id, $this->form_id, $this->entry['id'] );
246
+		self::$nonce_key = GravityView_Edit_Entry::get_nonce_key( $this->view_id, $this->form_id, $this->entry[ 'id' ] );
247 247
 	}
248 248
 
249 249
 
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
 	private function print_scripts() {
303 303
 		$gravityview_view = GravityView_View::getInstance();
304 304
 
305
-		wp_register_script( 'gform_gravityforms', GFCommon::get_base_url().'/js/gravityforms.js', array( 'jquery', 'gform_json', 'gform_placeholder', 'sack', 'plupload-all', 'gravityview-fe-view' ) );
305
+		wp_register_script( 'gform_gravityforms', GFCommon::get_base_url() . '/js/gravityforms.js', array( 'jquery', 'gform_json', 'gform_placeholder', 'sack', 'plupload-all', 'gravityview-fe-view' ) );
306 306
 
307
-		GFFormDisplay::enqueue_form_scripts( $gravityview_view->getForm(), false);
307
+		GFFormDisplay::enqueue_form_scripts( $gravityview_view->getForm(), false );
308 308
 
309 309
 		wp_localize_script( 'gravityview-fe-view', 'gvGlobals', array( 'cookiepath' => COOKIEPATH ) );
310 310
 
@@ -323,19 +323,19 @@  discard block
 block discarded – undo
323 323
 	 */
324 324
 	private function process_save( $gv_data ) {
325 325
 
326
-		if ( empty( $_POST ) || ! isset( $_POST['lid'] ) ) {
326
+		if ( empty( $_POST ) || ! isset( $_POST[ 'lid' ] ) ) {
327 327
 			return;
328 328
 		}
329 329
 
330 330
 		// Make sure the entry, view, and form IDs are all correct
331 331
 		$valid = $this->verify_nonce();
332 332
 
333
-		if ( !$valid ) {
333
+		if ( ! $valid ) {
334 334
 			gravityview()->log->error( 'Nonce validation failed.' );
335 335
 			return;
336 336
 		}
337 337
 
338
-		if ( $this->entry['id'] !== $_POST['lid'] ) {
338
+		if ( $this->entry[ 'id' ] !== $_POST[ 'lid' ] ) {
339 339
 			gravityview()->log->error( 'Entry ID did not match posted entry ID.' );
340 340
 			return;
341 341
 		}
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 
347 347
 		$this->validate();
348 348
 
349
-		if( $this->is_valid ) {
349
+		if ( $this->is_valid ) {
350 350
 
351 351
 			gravityview()->log->debug( 'Submission is valid.' );
352 352
 
@@ -358,15 +358,15 @@  discard block
 block discarded – undo
358 358
 			/**
359 359
 			 * @hack to avoid the capability validation of the method save_lead for GF 1.9+
360 360
 			 */
361
-			unset( $_GET['page'] );
361
+			unset( $_GET[ 'page' ] );
362 362
 
363
-			$date_created = $this->entry['date_created'];
363
+			$date_created = $this->entry[ 'date_created' ];
364 364
 
365 365
 			/**
366 366
 			 * @hack to force Gravity Forms to use $read_value_from_post in GFFormsModel::save_lead()
367 367
 			 * @since 1.17.2
368 368
 			 */
369
-			unset( $this->entry['date_created'] );
369
+			unset( $this->entry[ 'date_created' ] );
370 370
 
371 371
 			/**
372 372
 			 * @action `gravityview/edit_entry/before_update` Perform an action before the entry has been updated using Edit Entry
@@ -376,14 +376,14 @@  discard block
 block discarded – undo
376 376
 			 * @param GravityView_Edit_Entry_Render $this This object
377 377
 			 * @param GravityView_View_Data $gv_data The View data
378 378
 			 */
379
-			do_action( 'gravityview/edit_entry/before_update', $form, $this->entry['id'], $this, $gv_data );
379
+			do_action( 'gravityview/edit_entry/before_update', $form, $this->entry[ 'id' ], $this, $gv_data );
380 380
 
381 381
 			GFFormsModel::save_lead( $form, $this->entry );
382 382
 
383 383
 	        // Delete the values for hidden inputs
384 384
 	        $this->unset_hidden_field_values();
385 385
 
386
-			$this->entry['date_created'] = $date_created;
386
+			$this->entry[ 'date_created' ] = $date_created;
387 387
 
388 388
 			// Process calculation fields
389 389
 			$this->update_calculation_fields();
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 			 * @param GravityView_Edit_Entry_Render $this This object
409 409
 			 * @param GravityView_View_Data $gv_data The View data
410 410
 			 */
411
-			do_action( 'gravityview/edit_entry/after_update', $this->form, $this->entry['id'], $this, $gv_data );
411
+			do_action( 'gravityview/edit_entry/after_update', $this->form, $this->entry[ 'id' ], $this, $gv_data );
412 412
 
413 413
 		} else {
414 414
 			gravityview()->log->error( 'Submission is NOT valid.', array( 'entry' => $this->entry ) );
@@ -444,10 +444,10 @@  discard block
 block discarded – undo
444 444
 
445 445
 		if ( version_compare( GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) && method_exists( 'GFFormsModel', 'get_entry_meta_table_name' ) ) {
446 446
 			$entry_meta_table = GFFormsModel::get_entry_meta_table_name();
447
-			$current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $entry_meta_table WHERE entry_id=%d", $this->entry['id'] ) );
447
+			$current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $entry_meta_table WHERE entry_id=%d", $this->entry[ 'id' ] ) );
448 448
 		} else {
449 449
 			$lead_detail_table = GFFormsModel::get_lead_details_table_name();
450
-			$current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $lead_detail_table WHERE lead_id=%d", $this->entry['id'] ) );
450
+			$current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $lead_detail_table WHERE lead_id=%d", $this->entry[ 'id' ] ) );
451 451
 		}
452 452
 
453 453
 	    foreach ( $this->entry as $input_id => $field_value ) {
@@ -465,11 +465,11 @@  discard block
 block discarded – undo
465 465
 
466 466
 				$empty_value = $field->get_value_save_entry(
467 467
 					is_array( $field->get_entry_inputs() ) ? array() : '',
468
-					$this->form, '', $this->entry['id'], $this->entry
468
+					$this->form, '', $this->entry[ 'id' ], $this->entry
469 469
 				);
470 470
 
471 471
 				if ( $field->has_calculation() ) {
472
-					$this->unset_hidden_calculations[] = $field->id; // Unset
472
+					$this->unset_hidden_calculations[ ] = $field->id; // Unset
473 473
 					$empty_value = '';
474 474
 				}
475 475
 
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 	private function preset_approval_fields() {
499 499
 		$has_approved_field = false;
500 500
 
501
-		foreach ( self::$original_form['fields'] as $field ) {
501
+		foreach ( self::$original_form[ 'fields' ] as $field ) {
502 502
 			if ( $field->gravityview_approved ) {
503 503
 				$has_approved_field = true;
504 504
 				break;
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 
512 512
 		$is_field_hidden = true;
513 513
 
514
-		foreach ( $this->form['fields'] as $field ) {
514
+		foreach ( $this->form[ 'fields' ] as $field ) {
515 515
 			if ( $field->gravityview_approved ) {
516 516
 				$is_field_hidden = false;
517 517
 				break;
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 
537 537
 		remove_filter( 'gravityview/approve_entries/update_unapproved_meta', array( $this, 'prevent_update_unapproved_meta' ), 9 );
538 538
 
539
-		if ( ! $value = gform_get_meta( $entry['id'], 'is_approved' ) ) {
539
+		if ( ! $value = gform_get_meta( $entry[ 'id' ], 'is_approved' ) ) {
540 540
 
541 541
 			$value = GravityView_Entry_Approval_Status::UNAPPROVED;
542 542
 
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 		}
602 602
 
603 603
 		/** No file is being uploaded. */
604
-		if ( empty( $_FILES[ $input_name ]['name'] ) ) {
604
+		if ( empty( $_FILES[ $input_name ][ 'name' ] ) ) {
605 605
 			/** So return the original upload, with $value as backup (it can be empty during edit form rendering) */
606 606
 			return rgar( $entry, $input_id, $value );
607 607
 		}
@@ -619,11 +619,11 @@  discard block
 block discarded – undo
619 619
 	 * @return mixed
620 620
 	 */
621 621
 	public function modify_fileupload_settings( $plupload_init, $form_id, $instance ) {
622
-		if( ! $this->is_edit_entry() ) {
622
+		if ( ! $this->is_edit_entry() ) {
623 623
 			return $plupload_init;
624 624
 		}
625 625
 
626
-		$plupload_init['gf_vars']['max_files'] = 0;
626
+		$plupload_init[ 'gf_vars' ][ 'max_files' ] = 0;
627 627
 
628 628
 		return $plupload_init;
629 629
 	}
@@ -638,26 +638,26 @@  discard block
 block discarded – undo
638 638
 		$form = $this->filter_conditional_logic( $this->form );
639 639
 
640 640
 	    /** @type GF_Field $field */
641
-		foreach( $form['fields'] as $k => &$field ) {
641
+		foreach ( $form[ 'fields' ] as $k => &$field ) {
642 642
 
643 643
 			/**
644 644
 			 * Remove the fields with calculation formulas before save to avoid conflicts with GF logic
645 645
 			 * @since 1.16.3
646 646
 			 */
647
-			if( $field->has_calculation() ) {
648
-				unset( $form['fields'][ $k ] );
647
+			if ( $field->has_calculation() ) {
648
+				unset( $form[ 'fields' ][ $k ] );
649 649
 			}
650 650
 
651 651
 			$field->adminOnly = false;
652 652
 
653
-			if( isset( $field->inputs ) && is_array( $field->inputs ) ) {
654
-				foreach( $field->inputs as $key => $input ) {
655
-				    $field->inputs[ $key ][ 'id' ] = (string)$input['id'];
653
+			if ( isset( $field->inputs ) && is_array( $field->inputs ) ) {
654
+				foreach ( $field->inputs as $key => $input ) {
655
+				    $field->inputs[ $key ][ 'id' ] = (string)$input[ 'id' ];
656 656
 				}
657 657
 			}
658 658
 		}
659 659
 
660
-		$form['fields'] = array_values( $form['fields'] );
660
+		$form[ 'fields' ] = array_values( $form[ 'fields' ] );
661 661
 
662 662
 		return $form;
663 663
 	}
@@ -669,14 +669,14 @@  discard block
 block discarded – undo
669 669
 		$update = false;
670 670
 
671 671
 		// get the most up to date entry values
672
-		$entry = GFAPI::get_entry( $this->entry['id'] );
672
+		$entry = GFAPI::get_entry( $this->entry[ 'id' ] );
673 673
 
674 674
 		if ( version_compare( GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) && method_exists( 'GFFormsModel', 'get_entry_meta_table_name' ) ) {
675 675
 			$entry_meta_table = GFFormsModel::get_entry_meta_table_name();
676
-			$current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $entry_meta_table WHERE entry_id=%d", $entry['id'] ) );
676
+			$current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $entry_meta_table WHERE entry_id=%d", $entry[ 'id' ] ) );
677 677
 		} else {
678 678
 			$lead_detail_table = GFFormsModel::get_lead_details_table_name();
679
-			$current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $lead_detail_table WHERE lead_id=%d", $entry['id'] ) );
679
+			$current_fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $lead_detail_table WHERE lead_id=%d", $entry[ 'id' ] ) );
680 680
 		}
681 681
 
682 682
 
@@ -693,24 +693,24 @@  discard block
 block discarded – undo
693 693
 				$inputs = $field->get_entry_inputs();
694 694
 				if ( is_array( $inputs ) ) {
695 695
 				    foreach ( $inputs as $input ) {
696
-						list( $field_id, $input_id ) = rgexplode( '.', $input['id'], 2 );
696
+						list( $field_id, $input_id ) = rgexplode( '.', $input[ 'id' ], 2 );
697 697
 
698 698
 						if ( 'product' === $field->type ) {
699
-							$input_name = 'input_' . str_replace( '.', '_', $input['id'] );
699
+							$input_name = 'input_' . str_replace( '.', '_', $input[ 'id' ] );
700 700
 
701 701
 							// Only allow quantity to be set if it's allowed to be edited
702 702
 							if ( in_array( $field_id, $allowed_fields ) && $input_id == 3 ) {
703 703
 							} else { // otherwise set to what it previously was
704
-								$_POST[ $input_name ] = $entry[ $input['id'] ];
704
+								$_POST[ $input_name ] = $entry[ $input[ 'id' ] ];
705 705
 							}
706 706
 						} else {
707 707
 							// Set to what it previously was if it's not editable
708 708
 							if ( ! in_array( $field_id, $allowed_fields ) ) {
709
-								$_POST[ $input_name ] = $entry[ $input['id'] ];
709
+								$_POST[ $input_name ] = $entry[ $input[ 'id' ] ];
710 710
 							}
711 711
 						}
712 712
 
713
-						GFFormsModel::save_input( $form, $field, $entry, $current_fields, $input['id'] );
713
+						GFFormsModel::save_input( $form, $field, $entry, $current_fields, $input[ 'id' ] );
714 714
 				    }
715 715
 				} else {
716 716
 					// Set to what it previously was if it's not editable
@@ -750,19 +750,19 @@  discard block
 block discarded – undo
750 750
 
751 751
 		$input_name = 'input_' . $field_id;
752 752
 
753
-		if ( !empty( $_FILES[ $input_name ]['name'] ) ) {
753
+		if ( ! empty( $_FILES[ $input_name ][ 'name' ] ) ) {
754 754
 
755 755
 			// We have a new image
756 756
 
757
-			$value = RGFormsModel::prepare_value( $form, $field, $value, $input_name, $entry['id'] );
757
+			$value = RGFormsModel::prepare_value( $form, $field, $value, $input_name, $entry[ 'id' ] );
758 758
 
759 759
 			$ary = ! empty( $value ) ? explode( '|:|', $value ) : array();
760 760
 	        $ary = stripslashes_deep( $ary );
761 761
 			$img_url = \GV\Utils::get( $ary, 0 );
762 762
 
763
-			$img_title       = count( $ary ) > 1 ? $ary[1] : '';
764
-			$img_caption     = count( $ary ) > 2 ? $ary[2] : '';
765
-			$img_description = count( $ary ) > 3 ? $ary[3] : '';
763
+			$img_title       = count( $ary ) > 1 ? $ary[ 1 ] : '';
764
+			$img_caption     = count( $ary ) > 2 ? $ary[ 2 ] : '';
765
+			$img_description = count( $ary ) > 3 ? $ary[ 3 ] : '';
766 766
 
767 767
 			$image_meta = array(
768 768
 				'post_excerpt' => $img_caption,
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 
772 772
 			//adding title only if it is not empty. It will default to the file name if it is not in the array
773 773
 			if ( ! empty( $img_title ) ) {
774
-				$image_meta['post_title'] = $img_title;
774
+				$image_meta[ 'post_title' ] = $img_title;
775 775
 			}
776 776
 
777 777
 			/**
@@ -829,15 +829,15 @@  discard block
 block discarded – undo
829 829
 	 */
830 830
 	private function maybe_update_post_fields( $form ) {
831 831
 
832
-		if( empty( $this->entry['post_id'] ) ) {
832
+		if ( empty( $this->entry[ 'post_id' ] ) ) {
833 833
 	        gravityview()->log->debug( 'This entry has no post fields. Continuing...' );
834 834
 			return;
835 835
 		}
836 836
 
837
-		$post_id = $this->entry['post_id'];
837
+		$post_id = $this->entry[ 'post_id' ];
838 838
 
839 839
 		// Security check
840
-		if( false === GVCommon::has_cap( 'edit_post', $post_id ) ) {
840
+		if ( false === GVCommon::has_cap( 'edit_post', $post_id ) ) {
841 841
 			gravityview()->log->error( 'The current user does not have the ability to edit Post #{post_id}', array( 'post_id' => $post_id ) );
842 842
 			return;
843 843
 		}
@@ -850,25 +850,25 @@  discard block
 block discarded – undo
850 850
 
851 851
 			$field = RGFormsModel::get_field( $form, $field_id );
852 852
 
853
-			if( ! $field ) {
853
+			if ( ! $field ) {
854 854
 				continue;
855 855
 			}
856 856
 
857
-			if( GFCommon::is_post_field( $field ) && 'post_category' !== $field->type ) {
857
+			if ( GFCommon::is_post_field( $field ) && 'post_category' !== $field->type ) {
858 858
 
859 859
 				// Get the value of the field, including $_POSTed value
860 860
 				$value = RGFormsModel::get_field_value( $field );
861 861
 
862 862
 				// Use temporary entry variable, to make values available to fill_post_template() and update_post_image()
863 863
 				$entry_tmp = $this->entry;
864
-				$entry_tmp["{$field_id}"] = $value;
864
+				$entry_tmp[ "{$field_id}" ] = $value;
865 865
 
866
-				switch( $field->type ) {
866
+				switch ( $field->type ) {
867 867
 
868 868
 				    case 'post_title':
869 869
 				        $post_title = $value;
870 870
 				        if ( \GV\Utils::get( $form, 'postTitleTemplateEnabled' ) ) {
871
-				            $post_title = $this->fill_post_template( $form['postTitleTemplate'], $form, $entry_tmp );
871
+				            $post_title = $this->fill_post_template( $form[ 'postTitleTemplate' ], $form, $entry_tmp );
872 872
 				        }
873 873
 				        $updated_post->post_title = $post_title;
874 874
 				        $updated_post->post_name  = $post_title;
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 				    case 'post_content':
879 879
 				        $post_content = $value;
880 880
 				        if ( \GV\Utils::get( $form, 'postContentTemplateEnabled' ) ) {
881
-				            $post_content = $this->fill_post_template( $form['postContentTemplate'], $form, $entry_tmp, true );
881
+				            $post_content = $this->fill_post_template( $form[ 'postContentTemplate' ], $form, $entry_tmp, true );
882 882
 				        }
883 883
 				        $updated_post->post_content = $post_content;
884 884
 				        unset( $post_content );
@@ -896,11 +896,11 @@  discard block
 block discarded – undo
896 896
 							$value = $value[ $field_id ];
897 897
 						}
898 898
 
899
-				        if( ! empty( $field->customFieldTemplateEnabled ) ) {
899
+				        if ( ! empty( $field->customFieldTemplateEnabled ) ) {
900 900
 				            $value = $this->fill_post_template( $field->customFieldTemplate, $form, $entry_tmp, true );
901 901
 				        }
902 902
 
903
-						$value = $field->get_value_save_entry( $value, $form, '', $this->entry['id'], $this->entry );
903
+						$value = $field->get_value_save_entry( $value, $form, '', $this->entry[ 'id' ], $this->entry );
904 904
 
905 905
 				        update_post_meta( $post_id, $field->postCustomFieldName, $value );
906 906
 				        break;
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 				}
913 913
 
914 914
 				// update entry after
915
-				$this->entry["{$field_id}"] = $value;
915
+				$this->entry[ "{$field_id}" ] = $value;
916 916
 
917 917
 				$update_entry = true;
918 918
 
@@ -921,11 +921,11 @@  discard block
 block discarded – undo
921 921
 
922 922
 		}
923 923
 
924
-		if( $update_entry ) {
924
+		if ( $update_entry ) {
925 925
 
926 926
 			$return_entry = GFAPI::update_entry( $this->entry );
927 927
 
928
-			if( is_wp_error( $return_entry ) ) {
928
+			if ( is_wp_error( $return_entry ) ) {
929 929
 				gravityview()->log->error( 'Updating the entry post fields failed', array( 'data' => array( '$this->entry' => $this->entry, '$return_entry' => $return_entry ) ) );
930 930
 			} else {
931 931
 				gravityview()->log->debug( 'Updating the entry post fields for post #{post_id} succeeded', array( 'post_id' => $post_id ) );
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 
936 936
 		$return_post = wp_update_post( $updated_post, true );
937 937
 
938
-		if( is_wp_error( $return_post ) ) {
938
+		if ( is_wp_error( $return_post ) ) {
939 939
 			$return_post->add_data( $updated_post, '$updated_post' );
940 940
 			gravityview()->log->error( 'Updating the post content failed', array( 'data' => compact( 'updated_post', 'return_post' ) ) );
941 941
 		} else {
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 		$output = GFCommon::replace_variables( $output, $form, $entry, false, false, false );
970 970
 
971 971
 		// replace conditional shortcodes
972
-		if( $do_shortcode ) {
972
+		if ( $do_shortcode ) {
973 973
 			$output = do_shortcode( $output );
974 974
 		}
975 975
 
@@ -988,19 +988,19 @@  discard block
 block discarded – undo
988 988
 	 */
989 989
 	private function after_update() {
990 990
 
991
-		do_action( 'gform_after_update_entry', self::$original_form, $this->entry['id'], self::$original_entry );
992
-		do_action( "gform_after_update_entry_{$this->form['id']}", self::$original_form, $this->entry['id'], self::$original_entry );
991
+		do_action( 'gform_after_update_entry', self::$original_form, $this->entry[ 'id' ], self::$original_entry );
992
+		do_action( "gform_after_update_entry_{$this->form[ 'id' ]}", self::$original_form, $this->entry[ 'id' ], self::$original_entry );
993 993
 
994 994
 		// Re-define the entry now that we've updated it.
995
-		$entry = RGFormsModel::get_lead( $this->entry['id'] );
995
+		$entry = RGFormsModel::get_lead( $this->entry[ 'id' ] );
996 996
 
997 997
 		$entry = GFFormsModel::set_entry_meta( $entry, self::$original_form );
998 998
 
999 999
 		if ( version_compare( GFFormsModel::get_database_version(), '2.3-dev-1', '<' ) ) {
1000 1000
 			// We need to clear the cache because Gravity Forms caches the field values, which
1001 1001
 			// we have just updated.
1002
-			foreach ($this->form['fields'] as $key => $field) {
1003
-				GFFormsModel::refresh_lead_field_value( $entry['id'], $field->id );
1002
+			foreach ( $this->form[ 'fields' ] as $key => $field ) {
1003
+				GFFormsModel::refresh_lead_field_value( $entry[ 'id' ], $field->id );
1004 1004
 			}
1005 1005
 		}
1006 1006
 
@@ -1010,11 +1010,11 @@  discard block
 block discarded – undo
1010 1010
 		 * @since develop
1011 1011
 		 */
1012 1012
 		if ( $allowed_feeds = $this->view->settings->get( 'edit_feeds', array() ) ) {
1013
-			$feeds = GFAPI::get_feeds( null, $entry['form_id'] );
1013
+			$feeds = GFAPI::get_feeds( null, $entry[ 'form_id' ] );
1014 1014
 			if ( ! is_wp_error( $feeds ) ) {
1015 1015
 				$registered_feeds = array();
1016 1016
 				foreach ( GFAddOn::get_registered_addons() as $registered_feed ) {
1017
-					if ( is_subclass_of( $registered_feed,  'GFFeedAddOn' ) ) {
1017
+					if ( is_subclass_of( $registered_feed, 'GFFeedAddOn' ) ) {
1018 1018
 						if ( method_exists( $registered_feed, 'get_instance' ) ) {
1019 1019
 							$registered_feed = call_user_func( array( $registered_feed, 'get_instance' ) );
1020 1020
 							$registered_feeds[ $registered_feed->get_slug() ] = $registered_feed;
@@ -1022,8 +1022,8 @@  discard block
 block discarded – undo
1022 1022
 					}
1023 1023
 				}
1024 1024
 				foreach ( $feeds as $feed ) {
1025
-					if ( in_array( $feed['id'], $allowed_feeds ) ) {
1026
-						if ( $feed_object = \GV\Utils::get( $registered_feeds, $feed['addon_slug'] ) ) {
1025
+					if ( in_array( $feed[ 'id' ], $allowed_feeds ) ) {
1026
+						if ( $feed_object = \GV\Utils::get( $registered_feeds, $feed[ 'addon_slug' ] ) ) {
1027 1027
 							$returned_entry = $feed_object->process_feed( $feed, $entry, self::$original_form );
1028 1028
 							if ( is_array( $returned_entry ) && rgar( $returned_entry, 'id' ) ) {
1029 1029
 								$entry = $returned_entry;
@@ -1051,9 +1051,9 @@  discard block
 block discarded – undo
1051 1051
 
1052 1052
 		$view = \GV\View::by_id( $this->view_id );
1053 1053
 
1054
-		if( $view->settings->get( 'edit_locking' ) ) {
1054
+		if ( $view->settings->get( 'edit_locking' ) ) {
1055 1055
 			$locking = new GravityView_Edit_Entry_Locking();
1056
-			$locking->maybe_lock_object( $this->entry['id'] );
1056
+			$locking->maybe_lock_object( $this->entry[ 'id' ] );
1057 1057
 		}
1058 1058
 
1059 1059
 		?>
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
 
1067 1067
 		<div class="gv-edit-entry-wrapper"><?php
1068 1068
 
1069
-			$javascript = gravityview_ob_include( GravityView_Edit_Entry::$file .'/partials/inline-javascript.php', $this );
1069
+			$javascript = gravityview_ob_include( GravityView_Edit_Entry::$file . '/partials/inline-javascript.php', $this );
1070 1070
 
1071 1071
 			/**
1072 1072
 			 * Fixes weird wpautop() issue
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
 				     * @param string $edit_entry_title Modify the "Edit Entry" title
1083 1083
 				     * @param GravityView_Edit_Entry_Render $this This object
1084 1084
 				     */
1085
-				    $edit_entry_title = apply_filters('gravityview_edit_entry_title', __('Edit Entry', 'gravityview'), $this );
1085
+				    $edit_entry_title = apply_filters( 'gravityview_edit_entry_title', __( 'Edit Entry', 'gravityview' ), $this );
1086 1086
 
1087 1087
 				    echo esc_attr( $edit_entry_title );
1088 1088
 			?></span>
@@ -1148,18 +1148,18 @@  discard block
 block discarded – undo
1148 1148
 				*/
1149 1149
 				$labels = apply_filters( 'gravityview/edit_entry/button_labels', $labels, $this->form, $this->entry, $this->view_id );
1150 1150
 
1151
-				$this->is_paged_submitted = \GV\Utils::_POST( 'save' ) === $labels['submit'];
1151
+				$this->is_paged_submitted = \GV\Utils::_POST( 'save' ) === $labels[ 'submit' ];
1152 1152
 			}
1153 1153
 
1154 1154
 			$back_link = remove_query_arg( array( 'page', 'view', 'edit' ) );
1155 1155
 
1156
-			if( ! $this->is_valid ){
1156
+			if ( ! $this->is_valid ) {
1157 1157
 
1158 1158
 				// Keeping this compatible with Gravity Forms.
1159
-				$validation_message = "<div class='validation_error'>" . __('There was a problem with your submission.', 'gravityview') . " " . __('Errors have been highlighted below.', 'gravityview') . "</div>";
1160
-				$message = apply_filters("gform_validation_message_{$this->form['id']}", apply_filters("gform_validation_message", $validation_message, $this->form), $this->form);
1159
+				$validation_message = "<div class='validation_error'>" . __( 'There was a problem with your submission.', 'gravityview' ) . " " . __( 'Errors have been highlighted below.', 'gravityview' ) . "</div>";
1160
+				$message = apply_filters( "gform_validation_message_{$this->form[ 'id' ]}", apply_filters( "gform_validation_message", $validation_message, $this->form ), $this->form );
1161 1161
 
1162
-				echo GVCommon::generate_notice( $message , 'gv-error' );
1162
+				echo GVCommon::generate_notice( $message, 'gv-error' );
1163 1163
 
1164 1164
 			} elseif ( false === $this->is_paged_submitted ) {
1165 1165
 				// Paged form that hasn't been submitted on the last page yet
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 				 * @param int $view_id View ID
1173 1173
 				 * @param array $entry Gravity Forms entry array
1174 1174
 				 */
1175
-				$message = apply_filters( 'gravityview/edit_entry/page/success', $entry_updated_message , $this->view_id, $this->entry );
1175
+				$message = apply_filters( 'gravityview/edit_entry/page/success', $entry_updated_message, $this->view_id, $this->entry );
1176 1176
 
1177 1177
 				echo GVCommon::generate_notice( $message );
1178 1178
 			} else {
@@ -1184,23 +1184,23 @@  discard block
 block discarded – undo
1184 1184
 
1185 1185
                     case '0':
1186 1186
 	                    $redirect_url = $back_link;
1187
-	                    $entry_updated_message = sprintf( esc_attr_x('Entry Updated. %sReturning to Entry%s', 'Replacements are HTML', 'gravityview'), '<a href="'. esc_url( $redirect_url ) .'">', '</a>' );
1187
+	                    $entry_updated_message = sprintf( esc_attr_x( 'Entry Updated. %sReturning to Entry%s', 'Replacements are HTML', 'gravityview' ), '<a href="' . esc_url( $redirect_url ) . '">', '</a>' );
1188 1188
                         break;
1189 1189
 
1190 1190
                     case '1':
1191 1191
 	                    $redirect_url = $directory_link = GravityView_API::directory_link();
1192
-	                    $entry_updated_message = sprintf( esc_attr_x('Entry Updated. %sReturning to %s%s', 'Replacement 1 is HTML. Replacement 2 is the title of the page where the user will be taken. Replacement 3 is HTML.','gravityview'), '<a href="'. esc_url( $redirect_url ) . '">', esc_html( $view->post_title ), '</a>' );
1192
+	                    $entry_updated_message = sprintf( esc_attr_x( 'Entry Updated. %sReturning to %s%s', 'Replacement 1 is HTML. Replacement 2 is the title of the page where the user will be taken. Replacement 3 is HTML.', 'gravityview' ), '<a href="' . esc_url( $redirect_url ) . '">', esc_html( $view->post_title ), '</a>' );
1193 1193
 	                    break;
1194 1194
 
1195 1195
                     case '2':
1196 1196
 	                    $redirect_url = $edit_redirect_url;
1197 1197
 	                    $redirect_url = GFCommon::replace_variables( $redirect_url, $this->form, $this->entry, false, false, false, 'text' );
1198
-	                    $entry_updated_message = sprintf( esc_attr_x('Entry Updated. %sRedirecting to %s%s', 'Replacement 1 is HTML. Replacement 2 is the URL where the user will be taken. Replacement 3 is HTML.','gravityview'), '<a href="'. esc_url( $redirect_url ) . '">', esc_html( $edit_redirect_url ), '</a>' );
1198
+	                    $entry_updated_message = sprintf( esc_attr_x( 'Entry Updated. %sRedirecting to %s%s', 'Replacement 1 is HTML. Replacement 2 is the URL where the user will be taken. Replacement 3 is HTML.', 'gravityview' ), '<a href="' . esc_url( $redirect_url ) . '">', esc_html( $edit_redirect_url ), '</a>' );
1199 1199
                         break;
1200 1200
 
1201 1201
                     case '':
1202 1202
                     default:
1203
-					    $entry_updated_message = sprintf( esc_attr__('Entry Updated. %sReturn to Entry%s', 'gravityview'), '<a href="'. esc_url( $back_link ) .'">', '</a>' );
1203
+					    $entry_updated_message = sprintf( esc_attr__( 'Entry Updated. %sReturn to Entry%s', 'gravityview' ), '<a href="' . esc_url( $back_link ) . '">', '</a>' );
1204 1204
                         break;
1205 1205
 				}
1206 1206
 
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
 				 * @param array $entry Gravity Forms entry array
1217 1217
 				 * @param string $back_link URL to return to the original entry. @since 1.6
1218 1218
 				 */
1219
-				$message = apply_filters( 'gravityview/edit_entry/success', $entry_updated_message , $this->view_id, $this->entry, $back_link );
1219
+				$message = apply_filters( 'gravityview/edit_entry/success', $entry_updated_message, $this->view_id, $this->entry, $back_link );
1220 1220
 
1221 1221
 				echo GVCommon::generate_notice( $message );
1222 1222
 			}
@@ -1240,8 +1240,8 @@  discard block
 block discarded – undo
1240 1240
 		 */
1241 1241
 		do_action( 'gravityview/edit-entry/render/before', $this );
1242 1242
 
1243
-		add_filter( 'gform_pre_render', array( $this, 'filter_modify_form_fields'), 5000, 3 );
1244
-		add_filter( 'gform_submit_button', array( $this, 'render_form_buttons') );
1243
+		add_filter( 'gform_pre_render', array( $this, 'filter_modify_form_fields' ), 5000, 3 );
1244
+		add_filter( 'gform_submit_button', array( $this, 'render_form_buttons' ) );
1245 1245
 		add_filter( 'gform_next_button', array( $this, 'render_form_buttons' ) );
1246 1246
 		add_filter( 'gform_previous_button', array( $this, 'render_form_buttons' ) );
1247 1247
 		add_filter( 'gform_disable_view_counter', '__return_true' );
@@ -1250,14 +1250,14 @@  discard block
 block discarded – undo
1250 1250
 		add_filter( 'gform_field_input', array( $this, 'modify_edit_field_input' ), 10, 5 );
1251 1251
 
1252 1252
 		// We need to remove the fake $_GET['page'] arg to avoid rendering form as if in admin.
1253
-		unset( $_GET['page'] );
1253
+		unset( $_GET[ 'page' ] );
1254 1254
 
1255 1255
 		$this->show_next_button = false;
1256 1256
 		$this->show_previous_button = false;
1257 1257
 
1258 1258
 		// TODO: Verify multiple-page forms
1259 1259
 		if ( GFCommon::has_pages( $this->form ) && apply_filters( 'gravityview/features/paged-edit', false ) ) {
1260
-			if ( intval( $page_number = \GV\Utils::_POST( 'gform_source_page_number_' . $this->form['id'], 0 ) ) ) {
1260
+			if ( intval( $page_number = \GV\Utils::_POST( 'gform_source_page_number_' . $this->form[ 'id' ], 0 ) ) ) {
1261 1261
 
1262 1262
 				$labels = array(
1263 1263
 					'cancel'   => __( 'Cancel', 'gravityview' ),
@@ -1276,20 +1276,20 @@  discard block
 block discarded – undo
1276 1276
 				*/
1277 1277
 				$labels = apply_filters( 'gravityview/edit_entry/button_labels', $labels, $this->form, $this->entry, $this->view_id );
1278 1278
 
1279
-				GFFormDisplay::$submission[ $this->form['id'] ][ 'form' ] = $this->form;
1280
-				GFFormDisplay::$submission[ $this->form['id'] ][ 'is_valid' ] = true;
1279
+				GFFormDisplay::$submission[ $this->form[ 'id' ] ][ 'form' ] = $this->form;
1280
+				GFFormDisplay::$submission[ $this->form[ 'id' ] ][ 'is_valid' ] = true;
1281 1281
 
1282
-				if ( \GV\Utils::_POST( 'save' ) === $labels['next'] ) {
1282
+				if ( \GV\Utils::_POST( 'save' ) === $labels[ 'next' ] ) {
1283 1283
 					$last_page = \GFFormDisplay::get_max_page_number( $this->form );
1284 1284
 
1285 1285
 					while ( ++$page_number < $last_page && RGFormsModel::is_page_hidden( $this->form, $page_number, \GV\Utils::_POST( 'gform_field_values' ) ) ) {
1286 1286
 					} // Advance to next visible page
1287
-				} elseif ( \GV\Utils::_POST( 'save' ) === $labels['previous'] ) {
1287
+				} elseif ( \GV\Utils::_POST( 'save' ) === $labels[ 'previous' ] ) {
1288 1288
 					while ( --$page_number > 1 && RGFormsModel::is_page_hidden( $this->form, $page_number, \GV\Utils::_POST( 'gform_field_values' ) ) ) {
1289 1289
 					} // Advance to next visible page
1290 1290
 				}
1291 1291
 
1292
-				GFFormDisplay::$submission[ $this->form['id'] ]['page_number'] = $page_number;
1292
+				GFFormDisplay::$submission[ $this->form[ 'id' ] ][ 'page_number' ] = $page_number;
1293 1293
 			}
1294 1294
 
1295 1295
 			if ( ( $page_number = intval( $page_number ) ) < 2 ) {
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
 
1316 1316
 		ob_start(); // Prevent PHP warnings possibly caused by prefilling list fields for conditional logic
1317 1317
 
1318
-		$html = GFFormDisplay::get_form( $this->form['id'], false, false, true, $this->entry );
1318
+		$html = GFFormDisplay::get_form( $this->form[ 'id' ], false, false, true, $this->entry );
1319 1319
 
1320 1320
 		ob_get_clean();
1321 1321
 
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
 	 * @return string
1344 1344
 	 */
1345 1345
 	public function render_form_buttons() {
1346
-		return gravityview_ob_include( GravityView_Edit_Entry::$file .'/partials/form-buttons.php', $this );
1346
+		return gravityview_ob_include( GravityView_Edit_Entry::$file . '/partials/form-buttons.php', $this );
1347 1347
 	}
1348 1348
 
1349 1349
 
@@ -1362,15 +1362,15 @@  discard block
 block discarded – undo
1362 1362
 	 */
1363 1363
 	public function filter_modify_form_fields( $form, $ajax = false, $field_values = '' ) {
1364 1364
 
1365
-		if( $form['id'] != $this->form_id ) {
1365
+		if ( $form[ 'id' ] != $this->form_id ) {
1366 1366
 			return $form;
1367 1367
 		}
1368 1368
 
1369 1369
 		// In case we have validated the form, use it to inject the validation results into the form render
1370
-		if( isset( $this->form_after_validation ) && $this->form_after_validation['id'] === $form['id'] ) {
1370
+		if ( isset( $this->form_after_validation ) && $this->form_after_validation[ 'id' ] === $form[ 'id' ] ) {
1371 1371
 			$form = $this->form_after_validation;
1372 1372
 		} else {
1373
-			$form['fields'] = $this->get_configured_edit_fields( $form, $this->view_id );
1373
+			$form[ 'fields' ] = $this->get_configured_edit_fields( $form, $this->view_id );
1374 1374
 		}
1375 1375
 
1376 1376
 		$form = $this->filter_conditional_logic( $form );
@@ -1378,8 +1378,8 @@  discard block
 block discarded – undo
1378 1378
 		$form = $this->prefill_conditional_logic( $form );
1379 1379
 
1380 1380
 		// for now we don't support Save and Continue feature.
1381
-		if( ! self::$supports_save_and_continue ) {
1382
-	        unset( $form['save'] );
1381
+		if ( ! self::$supports_save_and_continue ) {
1382
+	        unset( $form[ 'save' ] );
1383 1383
 		}
1384 1384
 
1385 1385
 		$form = $this->unselect_default_values( $form );
@@ -1402,31 +1402,31 @@  discard block
 block discarded – undo
1402 1402
 	 */
1403 1403
 	public function verify_user_can_edit_post( $field_content = '', $field, $value, $lead_id = 0, $form_id ) {
1404 1404
 
1405
-		if( ! GFCommon::is_post_field( $field ) ) {
1405
+		if ( ! GFCommon::is_post_field( $field ) ) {
1406 1406
 			return $field_content;
1407 1407
 		}
1408 1408
 
1409 1409
         $message = null;
1410 1410
 
1411 1411
         // First, make sure they have the capability to edit the post.
1412
-        if( false === current_user_can( 'edit_post', $this->entry['post_id'] ) ) {
1412
+        if ( false === current_user_can( 'edit_post', $this->entry[ 'post_id' ] ) ) {
1413 1413
 
1414 1414
             /**
1415 1415
              * @filter `gravityview/edit_entry/unsupported_post_field_text` Modify the message when someone isn't able to edit a post
1416 1416
              * @param string $message The existing "You don't have permission..." text
1417 1417
              */
1418
-            $message = apply_filters('gravityview/edit_entry/unsupported_post_field_text', __('You don&rsquo;t have permission to edit this post.', 'gravityview') );
1418
+            $message = apply_filters( 'gravityview/edit_entry/unsupported_post_field_text', __( 'You don&rsquo;t have permission to edit this post.', 'gravityview' ) );
1419 1419
 
1420
-        } elseif( null === get_post( $this->entry['post_id'] ) ) {
1420
+        } elseif ( null === get_post( $this->entry[ 'post_id' ] ) ) {
1421 1421
             /**
1422 1422
              * @filter `gravityview/edit_entry/no_post_text` Modify the message when someone is editing an entry attached to a post that no longer exists
1423 1423
              * @param string $message The existing "This field is not editable; the post no longer exists." text
1424 1424
              */
1425
-            $message = apply_filters('gravityview/edit_entry/no_post_text', __('This field is not editable; the post no longer exists.', 'gravityview' ) );
1425
+            $message = apply_filters( 'gravityview/edit_entry/no_post_text', __( 'This field is not editable; the post no longer exists.', 'gravityview' ) );
1426 1426
         }
1427 1427
 
1428
-        if( $message ) {
1429
-            $field_content = sprintf('<div class="ginput_container ginput_container_' . $field->type . '">%s</div>', wpautop( $message ) );
1428
+        if ( $message ) {
1429
+            $field_content = sprintf( '<div class="ginput_container ginput_container_' . $field->type . '">%s</div>', wpautop( $message ) );
1430 1430
         }
1431 1431
 
1432 1432
         return $field_content;
@@ -1450,8 +1450,8 @@  discard block
 block discarded – undo
1450 1450
 
1451 1451
 		// If the form has been submitted, then we don't need to pre-fill the values,
1452 1452
 		// Except for fileupload type and when a field input is overridden- run always!!
1453
-		if(
1454
-			( $this->is_edit_entry_submission() && !in_array( $field->type, array( 'fileupload', 'post_image' ) ) )
1453
+		if (
1454
+			( $this->is_edit_entry_submission() && ! in_array( $field->type, array( 'fileupload', 'post_image' ) ) )
1455 1455
 			&& false === ( $gv_field && is_callable( array( $gv_field, 'get_field_input' ) ) )
1456 1456
 			&& ! GFCommon::is_product_field( $field->type )
1457 1457
 			|| ! empty( $field_content )
@@ -1471,7 +1471,7 @@  discard block
 block discarded – undo
1471 1471
 	    $return = null;
1472 1472
 
1473 1473
 		/** @var GravityView_Field $gv_field */
1474
-		if( $gv_field && is_callable( array( $gv_field, 'get_field_input' ) ) ) {
1474
+		if ( $gv_field && is_callable( array( $gv_field, 'get_field_input' ) ) ) {
1475 1475
 			$return = $gv_field->get_field_input( $this->form, $field_value, $this->entry, $field );
1476 1476
 		} else {
1477 1477
 	        $return = $field->get_field_input( $this->form, $field_value, $this->entry );
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
 	    // If there was output, it's an error
1481 1481
 	    $warnings = ob_get_clean();
1482 1482
 
1483
-	    if( !empty( $warnings ) ) {
1483
+	    if ( ! empty( $warnings ) ) {
1484 1484
 		    gravityview()->log->error( '{warning}', array( 'warning' => $warnings, 'data' => $field_value ) );
1485 1485
 	    }
1486 1486
 
@@ -1505,7 +1505,7 @@  discard block
 block discarded – undo
1505 1505
 		$override_saved_value = apply_filters( 'gravityview/edit_entry/pre_populate/override', false, $field );
1506 1506
 
1507 1507
 		// We're dealing with multiple inputs (e.g. checkbox) but not time or date (as it doesn't store data in input IDs)
1508
-		if( isset( $field->inputs ) && is_array( $field->inputs ) && !in_array( $field->type, array( 'time', 'date' ) ) ) {
1508
+		if ( isset( $field->inputs ) && is_array( $field->inputs ) && ! in_array( $field->type, array( 'time', 'date' ) ) ) {
1509 1509
 
1510 1510
 			$field_value = array();
1511 1511
 
@@ -1514,10 +1514,10 @@  discard block
 block discarded – undo
1514 1514
 
1515 1515
 			foreach ( (array)$field->inputs as $input ) {
1516 1516
 
1517
-				$input_id = strval( $input['id'] );
1517
+				$input_id = strval( $input[ 'id' ] );
1518 1518
 
1519 1519
 				if ( isset( $this->entry[ $input_id ] ) && ! gv_empty( $this->entry[ $input_id ], false, false ) ) {
1520
-				    $field_value[ $input_id ] =  'post_category' === $field->type ? GFCommon::format_post_category( $this->entry[ $input_id ], true ) : $this->entry[ $input_id ];
1520
+				    $field_value[ $input_id ] = 'post_category' === $field->type ? GFCommon::format_post_category( $this->entry[ $input_id ], true ) : $this->entry[ $input_id ];
1521 1521
 				    $allow_pre_populated = false;
1522 1522
 				}
1523 1523
 
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 
1526 1526
 			$pre_value = $field->get_value_submission( array(), false );
1527 1527
 
1528
-			$field_value = ! $allow_pre_populated && ! ( $override_saved_value && !gv_empty( $pre_value, false, false ) ) ? $field_value : $pre_value;
1528
+			$field_value = ! $allow_pre_populated && ! ( $override_saved_value && ! gv_empty( $pre_value, false, false ) ) ? $field_value : $pre_value;
1529 1529
 
1530 1530
 		} else {
1531 1531
 
@@ -1536,13 +1536,13 @@  discard block
 block discarded – undo
1536 1536
 
1537 1537
 			// saved field entry value (if empty, fallback to the pre-populated value, if exists)
1538 1538
 			// or pre-populated value if not empty and set to override saved value
1539
-			$field_value = isset( $this->entry[ $id ] ) && ! gv_empty( $this->entry[ $id ], false, false ) && ! ( $override_saved_value && !gv_empty( $pre_value, false, false ) ) ? $this->entry[ $id ] : $pre_value;
1539
+			$field_value = isset( $this->entry[ $id ] ) && ! gv_empty( $this->entry[ $id ], false, false ) && ! ( $override_saved_value && ! gv_empty( $pre_value, false, false ) ) ? $this->entry[ $id ] : $pre_value;
1540 1540
 
1541 1541
 			// in case field is post_category but inputType is select, multi-select or radio, convert value into array of category IDs.
1542
-			if ( 'post_category' === $field->type && !gv_empty( $field_value, false, false ) ) {
1542
+			if ( 'post_category' === $field->type && ! gv_empty( $field_value, false, false ) ) {
1543 1543
 				$categories = array();
1544 1544
 				foreach ( explode( ',', $field_value ) as $cat_string ) {
1545
-				    $categories[] = GFCommon::format_post_category( $cat_string, true );
1545
+				    $categories[ ] = GFCommon::format_post_category( $cat_string, true );
1546 1546
 				}
1547 1547
 				$field_value = 'multiselect' === $field->get_input_type() ? $categories : implode( '', $categories );
1548 1548
 			}
@@ -1570,7 +1570,7 @@  discard block
 block discarded – undo
1570 1570
 	     * @param GF_Field $field Gravity Forms field object
1571 1571
 	     * @param GravityView_Edit_Entry_Render $this Current object
1572 1572
 	     */
1573
-	    $field_value = apply_filters( 'gravityview/edit_entry/field_value_' . $field->type , $field_value, $field, $this );
1573
+	    $field_value = apply_filters( 'gravityview/edit_entry/field_value_' . $field->type, $field_value, $field, $this );
1574 1574
 
1575 1575
 		return $field_value;
1576 1576
 	}
@@ -1587,12 +1587,12 @@  discard block
 block discarded – undo
1587 1587
 	 */
1588 1588
 	public function gform_pre_validation( $form ) {
1589 1589
 
1590
-		if( ! $this->verify_nonce() ) {
1590
+		if ( ! $this->verify_nonce() ) {
1591 1591
 			return $form;
1592 1592
 		}
1593 1593
 
1594 1594
 		// Fix PHP warning regarding undefined index.
1595
-		foreach ( $form['fields'] as &$field) {
1595
+		foreach ( $form[ 'fields' ] as &$field ) {
1596 1596
 
1597 1597
 			// This is because we're doing admin form pretending to be front-end, so Gravity Forms
1598 1598
 			// expects certain field array items to be set.
@@ -1600,7 +1600,7 @@  discard block
 block discarded – undo
1600 1600
 	            $field->{$key} = isset( $field->{$key} ) ? $field->{$key} : NULL;
1601 1601
 			}
1602 1602
 
1603
-			switch( RGFormsModel::get_input_type( $field ) ) {
1603
+			switch ( RGFormsModel::get_input_type( $field ) ) {
1604 1604
 
1605 1605
 				/**
1606 1606
 				 * this whole fileupload hack is because in the admin, Gravity Forms simply doesn't update any fileupload field if it's empty, but it DOES in the frontend.
@@ -1614,26 +1614,26 @@  discard block
 block discarded – undo
1614 1614
 				    // Set the previous value
1615 1615
 				    $entry = $this->get_entry();
1616 1616
 
1617
-				    $input_name = 'input_'.$field->id;
1618
-				    $form_id = $form['id'];
1617
+				    $input_name = 'input_' . $field->id;
1618
+				    $form_id = $form[ 'id' ];
1619 1619
 
1620 1620
 				    $value = NULL;
1621 1621
 
1622 1622
 				    // Use the previous entry value as the default.
1623
-				    if( isset( $entry[ $field->id ] ) ) {
1623
+				    if ( isset( $entry[ $field->id ] ) ) {
1624 1624
 				        $value = $entry[ $field->id ];
1625 1625
 				    }
1626 1626
 
1627 1627
 				    // If this is a single upload file
1628
-				    if( !empty( $_FILES[ $input_name ] ) && !empty( $_FILES[ $input_name ]['name'] ) ) {
1629
-				        $file_path = GFFormsModel::get_file_upload_path( $form['id'], $_FILES[ $input_name ]['name'] );
1630
-				        $value = $file_path['url'];
1628
+				    if ( ! empty( $_FILES[ $input_name ] ) && ! empty( $_FILES[ $input_name ][ 'name' ] ) ) {
1629
+				        $file_path = GFFormsModel::get_file_upload_path( $form[ 'id' ], $_FILES[ $input_name ][ 'name' ] );
1630
+				        $value = $file_path[ 'url' ];
1631 1631
 
1632 1632
 				    } else {
1633 1633
 
1634 1634
 				        // Fix PHP warning on line 1498 of form_display.php for post_image fields
1635 1635
 				        // Fix PHP Notice:  Undefined index:  size in form_display.php on line 1511
1636
-				        $_FILES[ $input_name ] = array('name' => '', 'size' => '' );
1636
+				        $_FILES[ $input_name ] = array( 'name' => '', 'size' => '' );
1637 1637
 
1638 1638
 				    }
1639 1639
 
@@ -1643,7 +1643,7 @@  discard block
 block discarded – undo
1643 1643
 						if ( isset( GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] ) ) {
1644 1644
 							$value = empty( $value ) ? '[]' : $value;
1645 1645
 							$value = stripslashes_deep( $value );
1646
-							$value = GFFormsModel::prepare_value( $form, $field, $value, $input_name, $entry['id'], array() );
1646
+							$value = GFFormsModel::prepare_value( $form, $field, $value, $input_name, $entry[ 'id' ], array() );
1647 1647
 						} else if ( GFCommon::is_json( $value ) ) {
1648 1648
 							// Existing file; let GF derive the value from the `$_gf_uploaded_files` object (see `\GF_Field_FileUpload::get_multifile_value()`)
1649 1649
 							global $_gf_uploaded_files;
@@ -1663,8 +1663,8 @@  discard block
 block discarded – undo
1663 1663
 
1664 1664
 				case 'number':
1665 1665
 				    // Fix "undefined index" issue at line 1286 in form_display.php
1666
-				    if( !isset( $_POST['input_'.$field->id ] ) ) {
1667
-				        $_POST['input_'.$field->id ] = NULL;
1666
+				    if ( ! isset( $_POST[ 'input_' . $field->id ] ) ) {
1667
+				        $_POST[ 'input_' . $field->id ] = NULL;
1668 1668
 				    }
1669 1669
 				    break;
1670 1670
 			}
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
 		 * You can enter whatever you want!
1702 1702
 		 * We try validating, and customize the results using `self::custom_validation()`
1703 1703
 		 */
1704
-		add_filter( 'gform_validation_'. $this->form_id, array( $this, 'custom_validation' ), 10, 4);
1704
+		add_filter( 'gform_validation_' . $this->form_id, array( $this, 'custom_validation' ), 10, 4 );
1705 1705
 
1706 1706
 		// Needed by the validate funtion
1707 1707
 		$failed_validation_page = NULL;
@@ -1709,14 +1709,14 @@  discard block
 block discarded – undo
1709 1709
 
1710 1710
 		// Prevent entry limit from running when editing an entry, also
1711 1711
 		// prevent form scheduling from preventing editing
1712
-		unset( $this->form['limitEntries'], $this->form['scheduleForm'] );
1712
+		unset( $this->form[ 'limitEntries' ], $this->form[ 'scheduleForm' ] );
1713 1713
 
1714 1714
 		// Hide fields depending on Edit Entry settings
1715
-		$this->form['fields'] = $this->get_configured_edit_fields( $this->form, $this->view_id );
1715
+		$this->form[ 'fields' ] = $this->get_configured_edit_fields( $this->form, $this->view_id );
1716 1716
 
1717 1717
 		$this->is_valid = GFFormDisplay::validate( $this->form, $field_values, 1, $failed_validation_page );
1718 1718
 
1719
-		remove_filter( 'gform_validation_'. $this->form_id, array( $this, 'custom_validation' ), 10 );
1719
+		remove_filter( 'gform_validation_' . $this->form_id, array( $this, 'custom_validation' ), 10 );
1720 1720
 	}
1721 1721
 
1722 1722
 
@@ -1744,7 +1744,7 @@  discard block
 block discarded – undo
1744 1744
 
1745 1745
 		$gv_valid = true;
1746 1746
 
1747
-		foreach ( $validation_results['form']['fields'] as $key => &$field ) {
1747
+		foreach ( $validation_results[ 'form' ][ 'fields' ] as $key => &$field ) {
1748 1748
 			$value             = RGFormsModel::get_field_value( $field );
1749 1749
 			$field_type        = RGFormsModel::get_input_type( $field );
1750 1750
 			$is_required       = ! empty( $field->isRequired );
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
 
1753 1753
 			// Manually validate required fields as they can be skipped be skipped by GF's validation
1754 1754
 			// This can happen when the field is considered "hidden" (see `GFFormDisplay::validate`) due to unmet conditional logic
1755
-			if ( $is_required && !$failed_validation && empty( $value ) ) {
1755
+			if ( $is_required && ! $failed_validation && empty( $value ) ) {
1756 1756
 				$field->failed_validation  = true;
1757 1757
 				$field->validation_message = esc_html__( 'This field is required.', 'gravityview' );
1758 1758
 
@@ -1776,7 +1776,7 @@  discard block
 block discarded – undo
1776 1776
 					if ( \GV\Utils::get( $field, 'maxFiles' ) && \GV\Utils::get( $field, 'multipleFiles' ) ) {
1777 1777
 						$input_name = 'input_' . $field->id;
1778 1778
 						//uploaded
1779
-						$file_names = isset( GFFormsModel::$uploaded_files[ $validation_results['form']['id'] ][ $input_name ] ) ? GFFormsModel::$uploaded_files[ $validation_results['form']['id'] ][ $input_name ] : array();
1779
+						$file_names = isset( GFFormsModel::$uploaded_files[ $validation_results[ 'form' ][ 'id' ] ][ $input_name ] ) ? GFFormsModel::$uploaded_files[ $validation_results[ 'form' ][ 'id' ] ][ $input_name ] : array();
1780 1780
 
1781 1781
 						//existent
1782 1782
 						$entry = $this->get_entry();
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
 							$gv_valid                  = false;
1796 1796
 
1797 1797
 							// in case of error make sure the newest upload files are removed from the upload input
1798
-							GFFormsModel::$uploaded_files[ $validation_results['form']['id'] ] = null;
1798
+							GFFormsModel::$uploaded_files[ $validation_results[ 'form' ][ 'id' ] ] = null;
1799 1799
 						}
1800 1800
 					}
1801 1801
 
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
 			}
1804 1804
 
1805 1805
 			// This field has failed validation.
1806
-			if( !empty( $field->failed_validation ) ) {
1806
+			if ( ! empty( $field->failed_validation ) ) {
1807 1807
 
1808 1808
 				gravityview()->log->debug( 'GravityView_Edit_Entry[custom_validation] Field is invalid.', array( 'data' => array( 'field' => $field, 'value' => $value ) ) );
1809 1809
 
@@ -1821,19 +1821,19 @@  discard block
 block discarded – undo
1821 1821
 				}
1822 1822
 
1823 1823
 				// You can't continue inside a switch, so we do it after.
1824
-				if( empty( $field->failed_validation ) ) {
1824
+				if ( empty( $field->failed_validation ) ) {
1825 1825
 				    continue;
1826 1826
 				}
1827 1827
 
1828 1828
 				// checks if the No Duplicates option is not validating entry against itself, since
1829 1829
 				// we're editing a stored entry, it would also assume it's a duplicate.
1830
-				if( !empty( $field->noDuplicates ) ) {
1830
+				if ( ! empty( $field->noDuplicates ) ) {
1831 1831
 
1832 1832
 				    $entry = $this->get_entry();
1833 1833
 
1834 1834
 				    // If the value of the entry is the same as the stored value
1835 1835
 				    // Then we can assume it's not a duplicate, it's the same.
1836
-				    if( !empty( $entry ) && $value == $entry[ $field->id ] ) {
1836
+				    if ( ! empty( $entry ) && $value == $entry[ $field->id ] ) {
1837 1837
 				        //if value submitted was not changed, then don't validate
1838 1838
 				        $field->failed_validation = false;
1839 1839
 
@@ -1846,7 +1846,7 @@  discard block
 block discarded – undo
1846 1846
 				}
1847 1847
 
1848 1848
 				// if here then probably we are facing the validation 'At least one field must be filled out'
1849
-				if( GFFormDisplay::is_empty( $field, $this->form_id  ) && empty( $field->isRequired ) ) {
1849
+				if ( GFFormDisplay::is_empty( $field, $this->form_id ) && empty( $field->isRequired ) ) {
1850 1850
 				    unset( $field->validation_message );
1851 1851
 					$field->failed_validation = false;
1852 1852
 				    continue;
@@ -1858,12 +1858,12 @@  discard block
 block discarded – undo
1858 1858
 
1859 1859
 		}
1860 1860
 
1861
-		$validation_results['is_valid'] = $gv_valid;
1861
+		$validation_results[ 'is_valid' ] = $gv_valid;
1862 1862
 
1863 1863
 		gravityview()->log->debug( 'GravityView_Edit_Entry[custom_validation] Validation results.', array( 'data' => $validation_results ) );
1864 1864
 
1865 1865
 		// We'll need this result when rendering the form ( on GFFormDisplay::get_form )
1866
-		$this->form_after_validation = $validation_results['form'];
1866
+		$this->form_after_validation = $validation_results[ 'form' ];
1867 1867
 
1868 1868
 		return $validation_results;
1869 1869
 	}
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
 	 */
1877 1877
 	public function get_entry() {
1878 1878
 
1879
-		if( empty( $this->entry ) ) {
1879
+		if ( empty( $this->entry ) ) {
1880 1880
 			// Get the database value of the entry that's being edited
1881 1881
 			$this->entry = gravityview_get_entry( GravityView_frontend::is_single_entry() );
1882 1882
 		}
@@ -1908,10 +1908,10 @@  discard block
 block discarded – undo
1908 1908
 		}
1909 1909
 
1910 1910
 		// If edit tab not yet configured, show all fields
1911
-		$edit_fields = !empty( $properties['edit_edit-fields'] ) ? $properties['edit_edit-fields'] : NULL;
1911
+		$edit_fields = ! empty( $properties[ 'edit_edit-fields' ] ) ? $properties[ 'edit_edit-fields' ] : NULL;
1912 1912
 
1913 1913
 		// Hide fields depending on admin settings
1914
-		$fields = $this->filter_fields( $form['fields'], $edit_fields );
1914
+		$fields = $this->filter_fields( $form[ 'fields' ], $edit_fields );
1915 1915
 
1916 1916
 	    // If Edit Entry fields are configured, remove adminOnly field settings. Otherwise, don't.
1917 1917
 	    $fields = $this->filter_admin_only_fields( $fields, $edit_fields, $form, $view_id );
@@ -1944,7 +1944,7 @@  discard block
 block discarded – undo
1944 1944
 	 */
1945 1945
 	private function filter_fields( $fields, $configured_fields ) {
1946 1946
 
1947
-		if( empty( $fields ) || !is_array( $fields ) ) {
1947
+		if ( empty( $fields ) || ! is_array( $fields ) ) {
1948 1948
 			return $fields;
1949 1949
 		}
1950 1950
 
@@ -1961,12 +1961,12 @@  discard block
 block discarded – undo
1961 1961
 
1962 1962
 			// Remove the fields that have calculation properties and keep them to be used later
1963 1963
 			// @since 1.16.2
1964
-			if( $field->has_calculation() ) {
1965
-				$this->fields_with_calculation[] = $field;
1964
+			if ( $field->has_calculation() ) {
1965
+				$this->fields_with_calculation[ ] = $field;
1966 1966
 				// don't remove the calculation fields on form render.
1967 1967
 			}
1968 1968
 
1969
-			if( in_array( $field->type, $field_type_blacklist ) ) {
1969
+			if ( in_array( $field->type, $field_type_blacklist ) ) {
1970 1970
 				unset( $fields[ $key ] );
1971 1971
 			}
1972 1972
 		}
@@ -1996,7 +1996,7 @@  discard block
 block discarded – undo
1996 1996
 					continue; // Never include when no fields are configured
1997 1997
 				}
1998 1998
 
1999
-				$out_fields[] = $field;
1999
+				$out_fields[ ] = $field;
2000 2000
 			}
2001 2001
 
2002 2002
 			return array_values( $out_fields );
@@ -2007,8 +2007,8 @@  discard block
 block discarded – undo
2007 2007
 
2008 2008
 	        /** @var GF_Field $field */
2009 2009
 	        foreach ( $fields as $field ) {
2010
-				if( intval( $configured_field['id'] ) === intval( $field->id ) && $this->user_can_edit_field( $configured_field, false ) ) {
2011
-				    $edit_fields[] = $this->merge_field_properties( $field, $configured_field );
2010
+				if ( intval( $configured_field[ 'id' ] ) === intval( $field->id ) && $this->user_can_edit_field( $configured_field, false ) ) {
2011
+				    $edit_fields[ ] = $this->merge_field_properties( $field, $configured_field );
2012 2012
 				    break;
2013 2013
 				}
2014 2014
 
@@ -2031,14 +2031,14 @@  discard block
 block discarded – undo
2031 2031
 
2032 2032
 		$return_field = $field;
2033 2033
 
2034
-		if( empty( $field_setting['show_label'] ) ) {
2034
+		if ( empty( $field_setting[ 'show_label' ] ) ) {
2035 2035
 			$return_field->label = '';
2036
-		} elseif ( !empty( $field_setting['custom_label'] ) ) {
2037
-			$return_field->label = $field_setting['custom_label'];
2036
+		} elseif ( ! empty( $field_setting[ 'custom_label' ] ) ) {
2037
+			$return_field->label = $field_setting[ 'custom_label' ];
2038 2038
 		}
2039 2039
 
2040
-		if( !empty( $field_setting['custom_class'] ) ) {
2041
-			$return_field->cssClass .= ' '. gravityview_sanitize_html_class( $field_setting['custom_class'] );
2040
+		if ( ! empty( $field_setting[ 'custom_class' ] ) ) {
2041
+			$return_field->cssClass .= ' ' . gravityview_sanitize_html_class( $field_setting[ 'custom_class' ] );
2042 2042
 		}
2043 2043
 
2044 2044
 		/**
@@ -2076,16 +2076,16 @@  discard block
 block discarded – undo
2076 2076
 	     */
2077 2077
 	    $use_gf_adminonly_setting = apply_filters( 'gravityview/edit_entry/use_gf_admin_only_setting', empty( $edit_fields ), $form, $view_id );
2078 2078
 
2079
-	    if( $use_gf_adminonly_setting && false === GVCommon::has_cap( 'gravityforms_edit_entries', $this->entry['id'] ) ) {
2080
-			foreach( $fields as $k => $field ) {
2081
-				if( $field->adminOnly ) {
2079
+	    if ( $use_gf_adminonly_setting && false === GVCommon::has_cap( 'gravityforms_edit_entries', $this->entry[ 'id' ] ) ) {
2080
+			foreach ( $fields as $k => $field ) {
2081
+				if ( $field->adminOnly ) {
2082 2082
 				    unset( $fields[ $k ] );
2083 2083
 				}
2084 2084
 			}
2085 2085
 			return array_values( $fields );
2086 2086
 		}
2087 2087
 
2088
-	    foreach( $fields as &$field ) {
2088
+	    foreach ( $fields as &$field ) {
2089 2089
 		    $field->adminOnly = false;
2090 2090
 		}
2091 2091
 
@@ -2106,7 +2106,7 @@  discard block
 block discarded – undo
2106 2106
 	 */
2107 2107
 	private function unselect_default_values( $form ) {
2108 2108
 
2109
-	    foreach ( $form['fields'] as &$field ) {
2109
+	    foreach ( $form[ 'fields' ] as &$field ) {
2110 2110
 
2111 2111
 			if ( empty( $field->choices ) ) {
2112 2112
                 continue;
@@ -2114,7 +2114,7 @@  discard block
 block discarded – undo
2114 2114
 
2115 2115
             foreach ( $field->choices as &$choice ) {
2116 2116
 				if ( \GV\Utils::get( $choice, 'isSelected' ) ) {
2117
-					$choice['isSelected'] = false;
2117
+					$choice[ 'isSelected' ] = false;
2118 2118
 				}
2119 2119
 			}
2120 2120
 		}
@@ -2139,22 +2139,22 @@  discard block
 block discarded – undo
2139 2139
 	 */
2140 2140
 	function prefill_conditional_logic( $form ) {
2141 2141
 
2142
-		if( ! GFFormDisplay::has_conditional_logic( $form ) ) {
2142
+		if ( ! GFFormDisplay::has_conditional_logic( $form ) ) {
2143 2143
 			return $form;
2144 2144
 		}
2145 2145
 
2146 2146
 		// Have Conditional Logic pre-fill fields as if the data were default values
2147 2147
 		/** @var GF_Field $field */
2148
-		foreach ( $form['fields'] as &$field ) {
2148
+		foreach ( $form[ 'fields' ] as &$field ) {
2149 2149
 
2150
-			if( 'checkbox' === $field->type ) {
2150
+			if ( 'checkbox' === $field->type ) {
2151 2151
 				foreach ( $field->get_entry_inputs() as $key => $input ) {
2152
-				    $input_id = $input['id'];
2152
+				    $input_id = $input[ 'id' ];
2153 2153
 				    $choice = $field->choices[ $key ];
2154 2154
 				    $value = \GV\Utils::get( $this->entry, $input_id );
2155 2155
 				    $match = RGFormsModel::choice_value_match( $field, $choice, $value );
2156
-				    if( $match ) {
2157
-				        $field->choices[ $key ]['isSelected'] = true;
2156
+				    if ( $match ) {
2157
+				        $field->choices[ $key ][ 'isSelected' ] = true;
2158 2158
 				    }
2159 2159
 				}
2160 2160
 			} else {
@@ -2162,15 +2162,15 @@  discard block
 block discarded – undo
2162 2162
 				// We need to run through each field to set the default values
2163 2163
 				foreach ( $this->entry as $field_id => $field_value ) {
2164 2164
 
2165
-				    if( floatval( $field_id ) === floatval( $field->id ) ) {
2165
+				    if ( floatval( $field_id ) === floatval( $field->id ) ) {
2166 2166
 
2167
-				        if( 'list' === $field->type ) {
2167
+				        if ( 'list' === $field->type ) {
2168 2168
 				            $list_rows = maybe_unserialize( $field_value );
2169 2169
 
2170 2170
 				            $list_field_value = array();
2171
-				            foreach ( (array) $list_rows as $row ) {
2172
-				                foreach ( (array) $row as $column ) {
2173
-				                    $list_field_value[] = $column;
2171
+				            foreach ( (array)$list_rows as $row ) {
2172
+				                foreach ( (array)$row as $column ) {
2173
+				                    $list_field_value[ ] = $column;
2174 2174
 				                }
2175 2175
 				            }
2176 2176
 
@@ -2203,32 +2203,32 @@  discard block
 block discarded – undo
2203 2203
 		 * @see https://github.com/gravityview/GravityView/issues/840
2204 2204
 		 * @since develop
2205 2205
 		 */
2206
-		$the_form = GFAPI::get_form( $form['id'] );
2206
+		$the_form = GFAPI::get_form( $form[ 'id' ] );
2207 2207
 		$editable_ids = array();
2208
-		foreach ( $form['fields'] as $field ) {
2209
-			$editable_ids[] = $field['id']; // wp_list_pluck is destructive in this context
2208
+		foreach ( $form[ 'fields' ] as $field ) {
2209
+			$editable_ids[ ] = $field[ 'id' ]; // wp_list_pluck is destructive in this context
2210 2210
 		}
2211 2211
 		$remove_conditions_rule = array();
2212
-		foreach ( $the_form['fields'] as $field ) {
2213
-			if ( ! empty( $field->conditionalLogic ) && ! empty( $field->conditionalLogic['rules'] ) ) {
2214
-				foreach ( $field->conditionalLogic['rules'] as $i => $rule ) {
2215
-					if ( ! in_array( $rule['fieldId'], $editable_ids ) ) {
2212
+		foreach ( $the_form[ 'fields' ] as $field ) {
2213
+			if ( ! empty( $field->conditionalLogic ) && ! empty( $field->conditionalLogic[ 'rules' ] ) ) {
2214
+				foreach ( $field->conditionalLogic[ 'rules' ] as $i => $rule ) {
2215
+					if ( ! in_array( $rule[ 'fieldId' ], $editable_ids ) ) {
2216 2216
 						/**
2217 2217
 						 * This conditional field is not editable in this View.
2218 2218
 						 * We need to remove the rule, but only if it matches.
2219 2219
 						 */
2220
-						if ( $_field = GFAPI::get_field( $the_form, $rule['fieldId'] ) ) {
2220
+						if ( $_field = GFAPI::get_field( $the_form, $rule[ 'fieldId' ] ) ) {
2221 2221
 							$value = $_field->get_value_export( $this->entry );
2222
-						} elseif ( isset( $this->entry[ $rule['fieldId'] ] ) ) {
2223
-							$value = $this->entry[ $rule['fieldId'] ];
2222
+						} elseif ( isset( $this->entry[ $rule[ 'fieldId' ] ] ) ) {
2223
+							$value = $this->entry[ $rule[ 'fieldId' ] ];
2224 2224
 						} else {
2225
-							$value = gform_get_meta( $this->entry['id'], $rule['fieldId'] );
2225
+							$value = gform_get_meta( $this->entry[ 'id' ], $rule[ 'fieldId' ] );
2226 2226
 						}
2227 2227
 
2228
-						$match = GFFormsModel::matches_operation( $value, $rule['value'], $rule['operator'] );
2228
+						$match = GFFormsModel::matches_operation( $value, $rule[ 'value' ], $rule[ 'operator' ] );
2229 2229
 
2230 2230
 						if ( $match ) {
2231
-							$remove_conditions_rule[] = array( $field['id'], $i );
2231
+							$remove_conditions_rule[ ] = array( $field[ 'id' ], $i );
2232 2232
 						}
2233 2233
 					}
2234 2234
 				}
@@ -2236,21 +2236,21 @@  discard block
 block discarded – undo
2236 2236
 		}
2237 2237
 
2238 2238
 		if ( $remove_conditions_rule ) {
2239
-			foreach ( $form['fields'] as &$field ) {
2239
+			foreach ( $form[ 'fields' ] as &$field ) {
2240 2240
 				foreach ( $remove_conditions_rule as $_remove_conditions_r ) {
2241 2241
 
2242 2242
 				    list( $rule_field_id, $rule_i ) = $_remove_conditions_r;
2243 2243
 
2244
-					if ( $field['id'] == $rule_field_id ) {
2245
-						unset( $field->conditionalLogic['rules'][ $rule_i ] );
2246
-						gravityview()->log->debug( 'Removed conditional rule #{rule} for field {field_id}', array( 'rule' => $rule_i, 'field_id' => $field['id'] ) );
2244
+					if ( $field[ 'id' ] == $rule_field_id ) {
2245
+						unset( $field->conditionalLogic[ 'rules' ][ $rule_i ] );
2246
+						gravityview()->log->debug( 'Removed conditional rule #{rule} for field {field_id}', array( 'rule' => $rule_i, 'field_id' => $field[ 'id' ] ) );
2247 2247
 					}
2248 2248
 				}
2249 2249
 			}
2250 2250
 		}
2251 2251
 
2252 2252
 		/** Normalize the indices... */
2253
-		$form['fields'] = array_values( $form['fields'] );
2253
+		$form[ 'fields' ] = array_values( $form[ 'fields' ] );
2254 2254
 
2255 2255
 		/**
2256 2256
 		 * @filter `gravityview/edit_entry/conditional_logic` Should the Edit Entry form use Gravity Forms conditional logic showing/hiding of fields?
@@ -2260,16 +2260,16 @@  discard block
 block discarded – undo
2260 2260
 		 */
2261 2261
 		$use_conditional_logic = apply_filters( 'gravityview/edit_entry/conditional_logic', true, $form );
2262 2262
 
2263
-		if( $use_conditional_logic ) {
2263
+		if ( $use_conditional_logic ) {
2264 2264
 			return $form;
2265 2265
 		}
2266 2266
 
2267
-		foreach( $form['fields'] as &$field ) {
2267
+		foreach ( $form[ 'fields' ] as &$field ) {
2268 2268
 			/* @var GF_Field $field */
2269 2269
 			$field->conditionalLogic = null;
2270 2270
 		}
2271 2271
 
2272
-		unset( $form['button']['conditionalLogic'] );
2272
+		unset( $form[ 'button' ][ 'conditionalLogic' ] );
2273 2273
 
2274 2274
 		return $form;
2275 2275
 
@@ -2286,7 +2286,7 @@  discard block
 block discarded – undo
2286 2286
 	 */
2287 2287
 	public function manage_conditional_logic( $has_conditional_logic, $form ) {
2288 2288
 
2289
-		if( ! $this->is_edit_entry() ) {
2289
+		if ( ! $this->is_edit_entry() ) {
2290 2290
 			return $has_conditional_logic;
2291 2291
 		}
2292 2292
 
@@ -2318,44 +2318,44 @@  discard block
 block discarded – undo
2318 2318
 		 *  2. There are two entries embedded using oEmbed
2319 2319
 		 *  3. One of the entries has just been saved
2320 2320
 		 */
2321
-		if( !empty( $_POST['lid'] ) && !empty( $_GET['entry'] ) && ( $_POST['lid'] !== $_GET['entry'] ) ) {
2321
+		if ( ! empty( $_POST[ 'lid' ] ) && ! empty( $_GET[ 'entry' ] ) && ( $_POST[ 'lid' ] !== $_GET[ 'entry' ] ) ) {
2322 2322
 
2323 2323
 			$error = true;
2324 2324
 
2325 2325
 		}
2326 2326
 
2327
-		if( !empty( $_GET['entry'] ) && (string)$this->entry['id'] !== $_GET['entry'] ) {
2327
+		if ( ! empty( $_GET[ 'entry' ] ) && (string)$this->entry[ 'id' ] !== $_GET[ 'entry' ] ) {
2328 2328
 
2329 2329
 			$error = true;
2330 2330
 
2331
-		} elseif( ! $this->verify_nonce() ) {
2331
+		} elseif ( ! $this->verify_nonce() ) {
2332 2332
 
2333 2333
 			/**
2334 2334
 			 * If the Entry is embedded, there may be two entries on the same page.
2335 2335
 			 * If that's the case, and one is being edited, the other should fail gracefully and not display an error.
2336 2336
 			 */
2337
-			if( GravityView_oEmbed::getInstance()->get_entry_id() ) {
2337
+			if ( GravityView_oEmbed::getInstance()->get_entry_id() ) {
2338 2338
 				$error = true;
2339 2339
 			} else {
2340
-				$error = __( 'The link to edit this entry is not valid; it may have expired.', 'gravityview');
2340
+				$error = __( 'The link to edit this entry is not valid; it may have expired.', 'gravityview' );
2341 2341
 			}
2342 2342
 
2343 2343
 		}
2344 2344
 
2345
-		if( ! GravityView_Edit_Entry::check_user_cap_edit_entry( $this->entry ) ) {
2346
-			$error = __( 'You do not have permission to edit this entry.', 'gravityview');
2345
+		if ( ! GravityView_Edit_Entry::check_user_cap_edit_entry( $this->entry ) ) {
2346
+			$error = __( 'You do not have permission to edit this entry.', 'gravityview' );
2347 2347
 		}
2348 2348
 
2349
-		if( $this->entry['status'] === 'trash' ) {
2350
-			$error = __('You cannot edit the entry; it is in the trash.', 'gravityview' );
2349
+		if ( $this->entry[ 'status' ] === 'trash' ) {
2350
+			$error = __( 'You cannot edit the entry; it is in the trash.', 'gravityview' );
2351 2351
 		}
2352 2352
 
2353 2353
 		// No errors; everything's fine here!
2354
-		if( empty( $error ) ) {
2354
+		if ( empty( $error ) ) {
2355 2355
 			return true;
2356 2356
 		}
2357 2357
 
2358
-		if( $echo && $error !== true ) {
2358
+		if ( $echo && $error !== true ) {
2359 2359
 
2360 2360
 	        $error = esc_html( $error );
2361 2361
 
@@ -2363,10 +2363,10 @@  discard block
 block discarded – undo
2363 2363
 	         * @since 1.9
2364 2364
 	         */
2365 2365
 	        if ( ! empty( $this->entry ) ) {
2366
-		        $error .= ' ' . gravityview_get_link( '#', _x('Go back.', 'Link shown when invalid Edit Entry link is clicked', 'gravityview' ), array( 'onclick' => "window.history.go(-1); return false;" ) );
2366
+		        $error .= ' ' . gravityview_get_link( '#', _x( 'Go back.', 'Link shown when invalid Edit Entry link is clicked', 'gravityview' ), array( 'onclick' => "window.history.go(-1); return false;" ) );
2367 2367
 	        }
2368 2368
 
2369
-			echo GVCommon::generate_notice( wpautop( $error ), 'gv-error error');
2369
+			echo GVCommon::generate_notice( wpautop( $error ), 'gv-error error' );
2370 2370
 		}
2371 2371
 
2372 2372
 		gravityview()->log->error( '{error}', array( 'error' => $error ) );
@@ -2386,17 +2386,17 @@  discard block
 block discarded – undo
2386 2386
 
2387 2387
 		$error = NULL;
2388 2388
 
2389
-		if( ! $this->check_user_cap_edit_field( $field ) ) {
2390
-			$error = __( 'You do not have permission to edit this field.', 'gravityview');
2389
+		if ( ! $this->check_user_cap_edit_field( $field ) ) {
2390
+			$error = __( 'You do not have permission to edit this field.', 'gravityview' );
2391 2391
 		}
2392 2392
 
2393 2393
 		// No errors; everything's fine here!
2394
-		if( empty( $error ) ) {
2394
+		if ( empty( $error ) ) {
2395 2395
 			return true;
2396 2396
 		}
2397 2397
 
2398
-		if( $echo ) {
2399
-			echo GVCommon::generate_notice( wpautop( esc_html( $error ) ), 'gv-error error');
2398
+		if ( $echo ) {
2399
+			echo GVCommon::generate_notice( wpautop( esc_html( $error ) ), 'gv-error error' );
2400 2400
 		}
2401 2401
 
2402 2402
 		gravityview()->log->error( '{error}', array( 'error' => $error ) );
@@ -2417,14 +2417,14 @@  discard block
 block discarded – undo
2417 2417
 	private function check_user_cap_edit_field( $field ) {
2418 2418
 
2419 2419
 		// If they can edit any entries (as defined in Gravity Forms), we're good.
2420
-		if( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ) ) ) {
2420
+		if ( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ) ) ) {
2421 2421
 			return true;
2422 2422
 		}
2423 2423
 
2424
-		$field_cap = isset( $field['allow_edit_cap'] ) ? $field['allow_edit_cap'] : false;
2424
+		$field_cap = isset( $field[ 'allow_edit_cap' ] ) ? $field[ 'allow_edit_cap' ] : false;
2425 2425
 
2426
-		if( $field_cap ) {
2427
-			return GVCommon::has_cap( $field['allow_edit_cap'] );
2426
+		if ( $field_cap ) {
2427
+			return GVCommon::has_cap( $field[ 'allow_edit_cap' ] );
2428 2428
 		}
2429 2429
 
2430 2430
 		return false;
@@ -2438,17 +2438,17 @@  discard block
 block discarded – undo
2438 2438
 	public function verify_nonce() {
2439 2439
 
2440 2440
 		// Verify form submitted for editing single
2441
-		if( $this->is_edit_entry_submission() ) {
2441
+		if ( $this->is_edit_entry_submission() ) {
2442 2442
 			$valid = wp_verify_nonce( $_POST[ self::$nonce_field ], self::$nonce_field );
2443 2443
 		}
2444 2444
 
2445 2445
 		// Verify
2446
-		else if( ! $this->is_edit_entry() ) {
2446
+		else if ( ! $this->is_edit_entry() ) {
2447 2447
 			$valid = false;
2448 2448
 		}
2449 2449
 
2450 2450
 		else {
2451
-			$valid = wp_verify_nonce( $_GET['edit'], self::$nonce_key );
2451
+			$valid = wp_verify_nonce( $_GET[ 'edit' ], self::$nonce_key );
2452 2452
 		}
2453 2453
 
2454 2454
 		/**
@@ -2508,7 +2508,7 @@  discard block
 block discarded – undo
2508 2508
 		 */
2509 2509
 		$labels = apply_filters( 'gravityview/edit_entry/button_labels', $labels, $this->form, $this->entry, $this->view_id );
2510 2510
 
2511
-		return (array) $labels;
2511
+		return (array)$labels;
2512 2512
 	}
2513 2513
 
2514 2514
 } //end class
Please login to merge, or discard this patch.