Completed
Push — develop ( f28044...9183da )
by
unknown
18:42
created
includes/class-admin-welcome.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 	 * @since 1.0
34 34
 	 */
35 35
 	public function __construct() {
36
-		add_action( 'admin_menu', array( $this, 'admin_menus'), 200 );
36
+		add_action( 'admin_menu', array( $this, 'admin_menus' ), 200 );
37 37
 		add_action( 'admin_head', array( $this, 'admin_head' ) );
38
-		add_action( 'admin_init', array( $this, 'welcome'    ) );
39
-		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page'), 10, 2 );
38
+		add_action( 'admin_init', array( $this, 'welcome' ) );
39
+		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page' ), 10, 2 );
40 40
 	}
41 41
 
42 42
 	/**
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 		// Add help page to GravityView menu
52 52
 		add_submenu_page(
53 53
 			'edit.php?post_type=gravityview',
54
-			__('GravityView: Getting Started', 'gravityview'),
55
-			__('Getting Started', 'gravityview'),
54
+			__( 'GravityView: Getting Started', 'gravityview' ),
55
+			__( 'Getting Started', 'gravityview' ),
56 56
 			$this->minimum_capability,
57 57
 			'gv-getting-started',
58 58
 			array( $this, 'getting_started_screen' )
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @return boolean  $is_page   True: yep; false: nope
87 87
 	 */
88
-	public function is_dashboard_page($is_page = false, $hook = NULL) {
88
+	public function is_dashboard_page( $is_page = false, $hook = NULL ) {
89 89
 		global $plugin_page;
90 90
 
91
-		if($is_page) { return $is_page; }
91
+		if ( $is_page ) { return $is_page; }
92 92
 
93 93
 		return in_array( $plugin_page, array( 'gv-about', 'gv-credits', 'gv-getting-started' ) );
94 94
 	}
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-credits' );
106 106
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-changelog' );
107 107
 
108
-		if( !$this->is_dashboard_page() ) { return; }
108
+		if ( ! $this->is_dashboard_page() ) { return; }
109 109
 
110 110
 		?>
111 111
 		<style type="text/css" media="screen" xmlns="http://www.w3.org/1999/html">
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		// Don't fetch -beta, etc.
129 129
 		list( $display_version ) = explode( '-', GravityView_Plugin::version );
130 130
 
131
-		$selected = !empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
131
+		$selected = ! empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
132 132
 
133 133
 		echo gravityview_get_floaty( 132 );
134 134
 		?>
@@ -137,13 +137,13 @@  discard block
 block discarded – undo
137 137
 		<div class="about-text"><?php esc_html_e( 'Thank you for installing GravityView. Beautifully display your Gravity Forms entries.', 'gravityview' ); ?></div>
138 138
 
139 139
 		<h2 class="nav-tab-wrapper clear">
140
-			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
140
+			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
141 141
 				<?php _e( "Getting Started", 'gravityview' ); ?>
142 142
 			</a>
143
-			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
143
+			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
144 144
 				<?php _e( "List of Changes", 'gravityview' ); ?>
145 145
 			</a>
146
-			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
146
+			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
147 147
 				<?php _e( 'Credits', 'gravityview' ); ?>
148 148
 			</a>
149 149
 		</h2>
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 					<h3>Create a View</h3>
178 178
 
179 179
 					<ol class="ol-decimal">
180
-						<li>Go to <a href="<?php echo admin_url('post-new.php?post_type=gravityview'); ?>">Views &gt; New View</a></li>
180
+						<li>Go to <a href="<?php echo admin_url( 'post-new.php?post_type=gravityview' ); ?>">Views &gt; New View</a></li>
181 181
 						<li>If you want to <strong>create a new form</strong>, click the "Use a Form Preset" button</li>
182 182
 						<li>If you want to <strong>use an existing form&rsquo;s entries</strong>, select from the dropdown.</li>
183 183
 						<li>Select the type of View you would like to create. There are two core types of Views: <strong>Table</strong> and <strong>Listing</strong>.
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 					</ul>
632 632
 
633 633
 					<h4><?php esc_attr_e( 'Want to contribute?', 'gravityview' ); ?></h4>
634
-					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview'), '<a href="https://github.com/gravityview/GravityView">', '</a>' ); ?></p>
634
+					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview' ), '<a href="https://github.com/gravityview/GravityView">', '</a>' ); ?></p>
635 635
 				</div>
636 636
 			</div>
637 637
 
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
 		global $plugin_page;
674 674
 
675 675
 		// Bail if we're just editing the plugin
676
-		if( $plugin_page === 'plugin-editor.php' ) { return; }
676
+		if ( $plugin_page === 'plugin-editor.php' ) { return; }
677 677
 
678 678
 		// Bail if no activation redirect
679 679
 		if ( ! get_transient( '_gv_activation_redirect' ) ) { return; }
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 		$upgrade = get_option( 'gv_version_upgraded_from' );
685 685
 
686 686
 		// Don't do anything if they've already seen the new version info
687
-		if( $upgrade === GravityView_Plugin::version ) {
687
+		if ( $upgrade === GravityView_Plugin::version ) {
688 688
 			return;
689 689
 		}
690 690
 
@@ -692,10 +692,10 @@  discard block
 block discarded – undo
692 692
 		update_option( 'gv_version_upgraded_from', GravityView_Plugin::version );
693 693
 
694 694
 		// Bail if activating from network, or bulk
695
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; }
695
+		if ( is_network_admin() || isset( $_GET[ 'activate-multi' ] ) ) { return; }
696 696
 
697 697
 		// First time install
698
-		if( ! $upgrade ) {
698
+		if ( ! $upgrade ) {
699 699
 			wp_safe_redirect( admin_url( 'edit.php?post_type=gravityview&page=gv-getting-started' ) ); exit;
700 700
 		}
701 701
 		// Update
Please login to merge, or discard this patch.
includes/class-frontend-views.php 1 patch
Spacing   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 	private function __construct() {}
86 86
 
87 87
 	private function initialize() {
88
-		add_action( 'wp', array( $this, 'parse_content'), 11 );
88
+		add_action( 'wp', array( $this, 'parse_content' ), 11 );
89 89
 		add_filter( 'parse_query', array( $this, 'parse_query_fix_frontpage' ), 10 );
90
-		add_action( 'template_redirect', array( $this, 'set_entry_data'), 1 );
90
+		add_action( 'template_redirect', array( $this, 'set_entry_data' ), 1 );
91 91
 
92 92
 		// Enqueue scripts and styles after GravityView_Template::register_styles()
93 93
 		add_action( 'wp_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 20 );
@@ -234,18 +234,18 @@  discard block
 block discarded – undo
234 234
 
235 235
 		if ( ! empty( $view_id ) ) {
236 236
 
237
-			$this->context_view_id = (int) $view_id;
237
+			$this->context_view_id = (int)$view_id;
238 238
 
239
-		} elseif ( isset( $_GET['gvid'] ) && $multiple_views ) {
239
+		} elseif ( isset( $_GET[ 'gvid' ] ) && $multiple_views ) {
240 240
 			/**
241 241
 			 * used on a has_multiple_views context
242 242
 			 * @see GravityView_API::entry_link
243 243
 			 */
244
-			$this->context_view_id = (int) $_GET['gvid'];
244
+			$this->context_view_id = (int)$_GET[ 'gvid' ];
245 245
 
246 246
 		} elseif ( ! $multiple_views ) {
247 247
 			$array_keys = array_keys( $this->getGvOutputData()->get_views() );
248
-			$this->context_view_id = (int) array_pop( $array_keys );
248
+			$this->context_view_id = (int)array_pop( $array_keys );
249 249
 			unset( $array_keys );
250 250
 		}
251 251
 
@@ -278,25 +278,25 @@  discard block
 block discarded – undo
278 278
 		global $wp_rewrite;
279 279
 
280 280
 		$is_front_page = ( $query->is_home || $query->is_page );
281
-		$show_on_front = ( 'page' === get_option('show_on_front') );
282
-		$front_page_id = get_option('page_on_front');
281
+		$show_on_front = ( 'page' === get_option( 'show_on_front' ) );
282
+		$front_page_id = get_option( 'page_on_front' );
283 283
 
284
-		if (  $is_front_page && $show_on_front && $front_page_id ) {
284
+		if ( $is_front_page && $show_on_front && $front_page_id ) {
285 285
 
286 286
 			// Force to be an array, potentially a query string ( entry=16 )
287 287
 			$_query = wp_parse_args( $query->query );
288 288
 
289 289
 			// pagename can be set and empty depending on matched rewrite rules. Ignore an empty pagename.
290
-			if ( isset( $_query['pagename'] ) && '' === $_query['pagename'] ) {
291
-				unset( $_query['pagename'] );
290
+			if ( isset( $_query[ 'pagename' ] ) && '' === $_query[ 'pagename' ] ) {
291
+				unset( $_query[ 'pagename' ] );
292 292
 			}
293 293
 
294 294
 			// this is where will break from core wordpress
295 295
 			/** @internal Don't use this filter; it will be unnecessary soon - it's just a patch for specific use case */
296 296
 			$ignore = apply_filters( 'gravityview/internal/ignored_endpoints', array( 'preview', 'page', 'paged', 'cpage' ), $query );
297 297
 			$endpoints = \GV\Utils::get( $wp_rewrite, 'endpoints' );
298
-			foreach ( (array) $endpoints as $endpoint ) {
299
-				$ignore[] = $endpoint[1];
298
+			foreach ( (array)$endpoints as $endpoint ) {
299
+				$ignore[ ] = $endpoint[ 1 ];
300 300
 			}
301 301
 			unset( $endpoints );
302 302
 
@@ -306,21 +306,21 @@  discard block
 block discarded – undo
306 306
 			// - The query includes keys that are associated with registered endpoints. `entry`, for example.
307 307
 			if ( empty( $_query ) || ! array_diff( array_keys( $_query ), $ignore ) ) {
308 308
 
309
-				$qv =& $query->query_vars;
309
+				$qv = & $query->query_vars;
310 310
 
311 311
 				// Prevent redirect when on the single entry endpoint
312
-				if( self::is_single_entry() ) {
312
+				if ( self::is_single_entry() ) {
313 313
 					add_filter( 'redirect_canonical', '__return_false' );
314 314
 				}
315 315
 
316 316
 				$query->is_page = true;
317 317
 				$query->is_home = false;
318
-				$qv['page_id']  = $front_page_id;
318
+				$qv[ 'page_id' ]  = $front_page_id;
319 319
 
320 320
 				// Correct <!--nextpage--> for page_on_front
321
-				if ( ! empty( $qv['paged'] ) ) {
322
-					$qv['page'] = $qv['paged'];
323
-					unset( $qv['paged'] );
321
+				if ( ! empty( $qv[ 'paged' ] ) ) {
322
+					$qv[ 'page' ] = $qv[ 'paged' ];
323
+					unset( $qv[ 'paged' ] );
324 324
 				}
325 325
 			}
326 326
 
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
 			$blocks = parse_blocks( $post_content );
352 352
 
353 353
 			foreach ( $blocks as $block ) {
354
-				if ( empty( $block['attrs']['ref'] ) ) {
354
+				if ( empty( $block[ 'attrs' ][ 'ref' ] ) ) {
355 355
 					continue;
356 356
 				}
357 357
 
358
-				$block_post = get_post( $block['attrs']['ref'] );
358
+				$block_post = get_post( $block[ 'attrs' ][ 'ref' ] );
359 359
 
360 360
 				$post_content .= $block_post->post_content;
361 361
 			}
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
 		$search_method = GravityView_Widget_Search::getInstance()->get_search_method();
408 408
 
409
-		if( 'post' === $search_method ) {
409
+		if ( 'post' === $search_method ) {
410 410
 			$get = $_POST;
411 411
 		} else {
412 412
 			$get = $_GET;
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 		$gventry = gravityview()->request->is_entry();
459 459
 
460 460
 		// If this is the directory view, return.
461
-		if( ! $gventry ) {
461
+		if ( ! $gventry ) {
462 462
 			return $passed_title;
463 463
 		}
464 464
 
@@ -476,19 +476,19 @@  discard block
 block discarded – undo
476 476
 		}
477 477
 
478 478
 		// WooCommerce doesn't $post_id
479
-		if ( empty( $passed_post_id ) )  {
479
+		if ( empty( $passed_post_id ) ) {
480 480
 			return $passed_title;
481 481
 		}
482 482
 
483 483
 		// Don't modify the title for anything other than the current view/post.
484 484
 		// This is true for embedded shortcodes and Views.
485
-		if ( is_object( $post ) && (int) $post->ID !== (int) $passed_post_id ) {
485
+		if ( is_object( $post ) && (int)$post->ID !== (int)$passed_post_id ) {
486 486
 			return $passed_title;
487 487
 		}
488 488
 
489 489
 		$view = gravityview()->request->is_view();
490 490
 
491
-		if( $view ) {
491
+		if ( $view ) {
492 492
 			return $this->_get_single_entry_title( $view, $entry, $passed_title );
493 493
 		}
494 494
 
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 		$view_collection = \GV\View_Collection::from_post( $post );
512 512
 
513 513
 		// We have multiple Views, but no gvid...this isn't valid security
514
-		if( 1 < $view_collection->count() ) {
514
+		if ( 1 < $view_collection->count() ) {
515 515
 			return $passed_title;
516 516
 		}
517 517
 
@@ -545,18 +545,18 @@  discard block
 block discarded – undo
545 545
 		 */
546 546
 		$check_entry_display = apply_filters( 'gravityview/single/title/check_entry_display', true, $entry, $view );
547 547
 
548
-		if( $check_entry_display ) {
548
+		if ( $check_entry_display ) {
549 549
 
550 550
 			$check_display = GVCommon::check_entry_display( $entry, $view );
551 551
 
552
-			if( is_wp_error( $check_display ) ) {
552
+			if ( is_wp_error( $check_display ) ) {
553 553
 				return $passed_title;
554 554
 			}
555 555
 		}
556 556
 
557 557
 		$title = $view->settings->get( 'single_title', $passed_title );
558 558
 
559
-		$form = GVCommon::get_form( $entry['form_id'] );
559
+		$form = GVCommon::get_form( $entry[ 'form_id' ] );
560 560
 
561 561
 		// We are allowing HTML in the fields, so no escaping the output
562 562
 		$title = GravityView_API::replace_variables( $title, $form, $entry );
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 
628 628
 		$context = GravityView_View::getInstance()->getContext();
629 629
 
630
-		switch( $context ) {
630
+		switch ( $context ) {
631 631
 			case 'directory':
632 632
 				$tab = __( 'Multiple Entries', 'gravityview' );
633 633
 				break;
@@ -641,12 +641,12 @@  discard block
 block discarded – undo
641 641
 		}
642 642
 
643 643
 
644
-		$title = sprintf( esc_html_x('The %s layout has not been configured.', 'Displayed when a View is not configured. %s is replaced by the tab label', 'gravityview' ), $tab );
644
+		$title = sprintf( esc_html_x( 'The %s layout has not been configured.', 'Displayed when a View is not configured. %s is replaced by the tab label', 'gravityview' ), $tab );
645 645
 		$edit_link = admin_url( sprintf( 'post.php?post=%d&action=edit#%s-view', $view_id, $context ) );
646
-		$action_text = sprintf( esc_html__('Add fields to %s', 'gravityview' ), $tab );
646
+		$action_text = sprintf( esc_html__( 'Add fields to %s', 'gravityview' ), $tab );
647 647
 		$message = esc_html__( 'You can only see this message because you are able to edit this View.', 'gravityview' );
648 648
 
649
-		$image =  sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url(plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) );
649
+		$image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url( plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) );
650 650
 		$output = sprintf( '<h3>%s <strong><a href="%s">%s</a></strong></h3><p>%s</p>', $title, esc_url( $edit_link ), $action_text, $message );
651 651
 
652 652
 		echo GVCommon::generate_notice( $output . $image, 'gv-error error', 'edit_gravityview', $view_id );
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 		$direct_access = apply_filters( 'gravityview_direct_access', true, $view->ID );
694 694
 		$embed_only = $view->settings->get( 'embed_only' );
695 695
 
696
-		if( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
696
+		if ( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
697 697
 			return __( 'You are not allowed to view this content.', 'gravityview' );
698 698
 		}
699 699
 
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 				$datetime_format = 'Y-m-d H:i:s';
741 741
 				$search_is_outside_view_bounds = false;
742 742
 
743
-				if( ! empty( $search_criteria[ $key ] ) ) {
743
+				if ( ! empty( $search_criteria[ $key ] ) ) {
744 744
 
745 745
 					$search_date = strtotime( $search_criteria[ $key ], GFCommon::get_local_timestamp() );
746 746
 
@@ -768,14 +768,14 @@  discard block
 block discarded – undo
768 768
 				if ( empty( $search_criteria[ $key ] ) || $search_is_outside_view_bounds ) {
769 769
 
770 770
 					// Then we override the search and re-set the start date
771
-					$return_search_criteria[ $key ] = date_i18n( $datetime_format , $date, true );
771
+					$return_search_criteria[ $key ] = date_i18n( $datetime_format, $date, true );
772 772
 				}
773 773
 			}
774 774
 		}
775 775
 
776
-		if( isset( $return_search_criteria['start_date'] ) && isset( $return_search_criteria['end_date'] ) ) {
776
+		if ( isset( $return_search_criteria[ 'start_date' ] ) && isset( $return_search_criteria[ 'end_date' ] ) ) {
777 777
 			// The start date is AFTER the end date. This will result in no results, but let's not force the issue.
778
-			if ( strtotime( $return_search_criteria['start_date'] ) > strtotime( $return_search_criteria['end_date'] ) ) {
778
+			if ( strtotime( $return_search_criteria[ 'start_date' ] ) > strtotime( $return_search_criteria[ 'end_date' ] ) ) {
779 779
 				gravityview()->log->error( 'Invalid search: the start date is after the end date.', array( 'data' => $return_search_criteria ) );
780 780
 			}
781 781
 		}
@@ -794,19 +794,19 @@  discard block
 block discarded – undo
794 794
 	public static function process_search_only_approved( $args, $search_criteria ) {
795 795
 
796 796
 		/** @since 1.19 */
797
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
797
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
798 798
 			gravityview()->log->debug( 'User can moderate entries; showing all approval statuses' );
799 799
 			return $search_criteria;
800 800
 		}
801 801
 
802
-		if ( ! empty( $args['show_only_approved'] ) ) {
802
+		if ( ! empty( $args[ 'show_only_approved' ] ) ) {
803 803
 
804
-			$search_criteria['field_filters'][] = array(
804
+			$search_criteria[ 'field_filters' ][ ] = array(
805 805
 				'key' => GravityView_Entry_Approval::meta_key,
806 806
 				'value' => GravityView_Entry_Approval_Status::APPROVED
807 807
 			);
808 808
 
809
-			$search_criteria['field_filters']['mode'] = 'all'; // force all the criterias to be met
809
+			$search_criteria[ 'field_filters' ][ 'mode' ] = 'all'; // force all the criterias to be met
810 810
 
811 811
 			gravityview()->log->debug( '[process_search_only_approved] Search Criteria if show only approved: ', array( 'data' => $search_criteria ) );
812 812
 		}
@@ -833,18 +833,18 @@  discard block
 block discarded – undo
833 833
 	 */
834 834
 	public static function is_entry_approved( $entry, $args = array() ) {
835 835
 
836
-		if ( empty( $entry['id'] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args['show_only_approved'] ) ) {
836
+		if ( empty( $entry[ 'id' ] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args[ 'show_only_approved' ] ) ) {
837 837
 			// is implicitly approved if entry is null or View settings doesn't require to check for approval
838 838
 			return true;
839 839
 		}
840 840
 
841 841
 		/** @since 1.19 */
842
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
842
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
843 843
 			gravityview()->log->debug( 'User can moderate entries, so entry is approved for viewing' );
844 844
 			return true;
845 845
 		}
846 846
 
847
-		$is_approved = gform_get_meta( $entry['id'], GravityView_Entry_Approval::meta_key );
847
+		$is_approved = gform_get_meta( $entry[ 'id' ], GravityView_Entry_Approval::meta_key );
848 848
 
849 849
 		return GravityView_Entry_Approval_Status::is_approved( $is_approved );
850 850
 	}
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 		 * Compatibility with filters hooking in `gravityview_search_criteria` instead of `gravityview_fe_search_criteria`.
869 869
 		 */
870 870
 		$criteria = apply_filters( 'gravityview_search_criteria', array(), array( $form_id ), \GV\Utils::get( $args, 'id' ) );
871
-		$search_criteria = isset( $criteria['search_criteria'] ) ? $criteria['search_criteria'] : array( 'field_filters' => array() );
871
+		$search_criteria = isset( $criteria[ 'search_criteria' ] ) ? $criteria[ 'search_criteria' ] : array( 'field_filters' => array() );
872 872
 
873 873
 		/**
874 874
 		 * @filter `gravityview_fe_search_criteria` Modify the search criteria
@@ -888,29 +888,29 @@  discard block
 block discarded – undo
888 888
 		gravityview()->log->debug( '[get_search_criteria] Search Criteria after hook gravityview_fe_search_criteria: ', array( 'data' =>$search_criteria ) );
889 889
 
890 890
 		// implicity search
891
-		if ( ! empty( $args['search_value'] ) ) {
891
+		if ( ! empty( $args[ 'search_value' ] ) ) {
892 892
 
893 893
 			// Search operator options. Options: `is` or `contains`
894
-			$operator = ! empty( $args['search_operator'] ) && in_array( $args['search_operator'], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args['search_operator'] : 'contains';
894
+			$operator = ! empty( $args[ 'search_operator' ] ) && in_array( $args[ 'search_operator' ], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args[ 'search_operator' ] : 'contains';
895 895
 
896
-			$search_criteria['field_filters'][] = array(
896
+			$search_criteria[ 'field_filters' ][ ] = array(
897 897
 				'key' => \GV\Utils::_GET( 'search_field', \GV\Utils::get( $args, 'search_field' ) ), // The field ID to search
898
-				'value' => _wp_specialchars( $args['search_value'] ), // The value to search. Encode ampersands but not quotes.
898
+				'value' => _wp_specialchars( $args[ 'search_value' ] ), // The value to search. Encode ampersands but not quotes.
899 899
 				'operator' => $operator,
900 900
 			);
901 901
 
902 902
 			// Lock search mode to "all" with implicit presearch filter.
903
-			$search_criteria['field_filters']['mode'] = 'all';
903
+			$search_criteria[ 'field_filters' ][ 'mode' ] = 'all';
904 904
 		}
905 905
 
906
-		if( $search_criteria !== $original_search_criteria ) {
906
+		if ( $search_criteria !== $original_search_criteria ) {
907 907
 			gravityview()->log->debug( '[get_search_criteria] Search Criteria after implicity search: ', array( 'data' => $search_criteria ) );
908 908
 		}
909 909
 
910 910
 		// Handle setting date range
911 911
 		$search_criteria = self::process_search_dates( $args, $search_criteria );
912 912
 
913
-		if( $search_criteria !== $original_search_criteria ) {
913
+		if ( $search_criteria !== $original_search_criteria ) {
914 914
 			gravityview()->log->debug( '[get_search_criteria] Search Criteria after date params: ', array( 'data' => $search_criteria ) );
915 915
 		}
916 916
 
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
 		 * @filter `gravityview_status` Modify entry status requirements to be included in search results.
922 922
 		 * @param string $status Default: `active`. Accepts all Gravity Forms entry statuses, including `spam` and `trash`
923 923
 		 */
924
-		$search_criteria['status'] = apply_filters( 'gravityview_status', 'active', $args );
924
+		$search_criteria[ 'status' ] = apply_filters( 'gravityview_status', 'active', $args );
925 925
 
926 926
 		return $search_criteria;
927 927
 	}
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 			'search_criteria' => $search_criteria,
1034 1034
 			'sorting' => self::updateViewSorting( $args, $form_id ),
1035 1035
 			'paging' => $paging,
1036
-			'cache' => isset( $args['cache'] ) ? $args['cache'] : true,
1036
+			'cache' => isset( $args[ 'cache' ] ) ? $args[ 'cache' ] : true,
1037 1037
 		);
1038 1038
 
1039 1039
 		/**
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 		 * @param array $parameters Array with `search_criteria`, `sorting` and `paging` keys.
1059 1059
 		 * @param array $args View configuration args.
1060 1060
 		 */
1061
-		$parameters = apply_filters( 'gravityview_get_entries_'.\GV\Utils::get( $args, 'id' ), $parameters, $args, $form_id );
1061
+		$parameters = apply_filters( 'gravityview_get_entries_' . \GV\Utils::get( $args, 'id' ), $parameters, $args, $form_id );
1062 1062
 
1063 1063
 		gravityview()->log->debug( '$parameters passed to gravityview_get_entries(): ', array( 'data' => $parameters ) );
1064 1064
 
@@ -1083,17 +1083,17 @@  discard block
 block discarded – undo
1083 1083
 		$default_page_size = apply_filters( 'gravityview_default_page_size', 25 );
1084 1084
 
1085 1085
 		// Paging & offset
1086
-		$page_size = ! empty( $args['page_size'] ) ? intval( $args['page_size'] ) : $default_page_size;
1086
+		$page_size = ! empty( $args[ 'page_size' ] ) ? intval( $args[ 'page_size' ] ) : $default_page_size;
1087 1087
 
1088 1088
 		if ( -1 === $page_size ) {
1089 1089
 			$page_size = PHP_INT_MAX;
1090 1090
 		}
1091 1091
 
1092
-		$curr_page = empty( $_GET['pagenum'] ) ? 1 : intval( $_GET['pagenum'] );
1092
+		$curr_page = empty( $_GET[ 'pagenum' ] ) ? 1 : intval( $_GET[ 'pagenum' ] );
1093 1093
 		$offset = ( $curr_page - 1 ) * $page_size;
1094 1094
 
1095
-		if ( ! empty( $args['offset'] ) ) {
1096
-			$offset += intval( $args['offset'] );
1095
+		if ( ! empty( $args[ 'offset' ] ) ) {
1096
+			$offset += intval( $args[ 'offset' ] );
1097 1097
 		}
1098 1098
 
1099 1099
 		$paging = array(
@@ -1118,11 +1118,11 @@  discard block
 block discarded – undo
1118 1118
 	public static function updateViewSorting( $args, $form_id ) {
1119 1119
 		$sorting = array();
1120 1120
 
1121
-		$has_values = isset( $_GET['sort'] );
1121
+		$has_values = isset( $_GET[ 'sort' ] );
1122 1122
 
1123
-		if ( $has_values && is_array( $_GET['sort'] ) ) {
1124
-			$sorts = array_keys( $_GET['sort'] );
1125
-			$dirs  = array_values( $_GET['sort'] );
1123
+		if ( $has_values && is_array( $_GET[ 'sort' ] ) ) {
1124
+			$sorts = array_keys( $_GET[ 'sort' ] );
1125
+			$dirs  = array_values( $_GET[ 'sort' ] );
1126 1126
 
1127 1127
 			if ( $has_values = array_filter( $dirs ) ) {
1128 1128
 				$sort_field_id = end( $sorts );
@@ -1131,11 +1131,11 @@  discard block
 block discarded – undo
1131 1131
 		}
1132 1132
 
1133 1133
 		if ( ! isset( $sort_field_id ) ) {
1134
-			$sort_field_id = isset( $_GET['sort'] ) ? $_GET['sort'] : \GV\Utils::get( $args, 'sort_field' );
1134
+			$sort_field_id = isset( $_GET[ 'sort' ] ) ? $_GET[ 'sort' ] : \GV\Utils::get( $args, 'sort_field' );
1135 1135
 		}
1136 1136
 
1137 1137
 		if ( ! isset( $sort_direction ) ) {
1138
-			$sort_direction = isset( $_GET['dir'] ) ? $_GET['dir'] : \GV\Utils::get( $args, 'sort_direction' );
1138
+			$sort_direction = isset( $_GET[ 'dir' ] ) ? $_GET[ 'dir' ] : \GV\Utils::get( $args, 'sort_direction' );
1139 1139
 		}
1140 1140
 
1141 1141
 		if ( is_array( $sort_field_id ) ) {
@@ -1167,10 +1167,10 @@  discard block
 block discarded – undo
1167 1167
 				$form = GFAPI::get_form( $form_id );
1168 1168
 
1169 1169
 				// Get the first GF_Field field ID, set as the key for entry randomization
1170
-				if ( ! empty( $form['fields'] ) ) {
1170
+				if ( ! empty( $form[ 'fields' ] ) ) {
1171 1171
 
1172 1172
 					/** @var GF_Field $field */
1173
-					foreach ( $form['fields'] as $field ) {
1173
+					foreach ( $form[ 'fields' ] as $field ) {
1174 1174
 						if ( ! is_a( $field, 'GF_Field' ) ) {
1175 1175
 							continue;
1176 1176
 						}
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
 		if ( is_array( $sort_field_id ) ) {
1216 1216
 			$modified_ids = array();
1217 1217
 			foreach ( $sort_field_id as $_sort_field_id ) {
1218
-				$modified_ids []= self::_override_sorting_id_by_field_type( $_sort_field_id, $form_id );
1218
+				$modified_ids [ ] = self::_override_sorting_id_by_field_type( $_sort_field_id, $form_id );
1219 1219
 			}
1220 1220
 			return $modified_ids;
1221 1221
 		}
@@ -1224,11 +1224,11 @@  discard block
 block discarded – undo
1224 1224
 
1225 1225
 		$sort_field = GFFormsModel::get_field( $form, $sort_field_id );
1226 1226
 
1227
-		if( ! $sort_field ) {
1227
+		if ( ! $sort_field ) {
1228 1228
 			return $sort_field_id;
1229 1229
 		}
1230 1230
 
1231
-		switch ( $sort_field['type'] ) {
1231
+		switch ( $sort_field[ 'type' ] ) {
1232 1232
 
1233 1233
 			case 'address':
1234 1234
 				// Sorting by full address
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
 					 */
1246 1246
 					$address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id );
1247 1247
 
1248
-					switch( strtolower( $address_part ) ){
1248
+					switch ( strtolower( $address_part ) ) {
1249 1249
 						case 'street':
1250 1250
 							$sort_field_id .= '.1';
1251 1251
 							break;
@@ -1318,7 +1318,7 @@  discard block
 block discarded – undo
1318 1318
 		if ( ! class_exists( '\GV\Entry' ) ) {
1319 1319
 
1320 1320
 			// Not using gravityview()->log->error(), since that may not exist yet either!
1321
-			do_action( 'gravityview_log_error', '\GV\Entry not defined yet. Backtrace: ' . wp_debug_backtrace_summary()  );
1321
+			do_action( 'gravityview_log_error', '\GV\Entry not defined yet. Backtrace: ' . wp_debug_backtrace_summary() );
1322 1322
 
1323 1323
 			return null;
1324 1324
 		}
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
 		 */
1336 1336
 		$single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry );
1337 1337
 
1338
-		if ( empty( $single_entry ) ){
1338
+		if ( empty( $single_entry ) ) {
1339 1339
 			return false;
1340 1340
 		} else {
1341 1341
 			return $single_entry;
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
 			$views = $this->getGvOutputData()->get_views();
1357 1357
 
1358 1358
 			foreach ( $views as $view_id => $data ) {
1359
-				$view = \GV\View::by_id( $data['id'] );
1359
+				$view = \GV\View::by_id( $data[ 'id' ] );
1360 1360
 				$view_id = $view->ID;
1361 1361
 				$template_id = gravityview_get_template_id( $view->ID );
1362 1362
 				$data = $view->as_data();
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
 				 * Don't enqueue the scripts or styles if it's not going to be displayed.
1366 1366
 				 * @since 1.15
1367 1367
 				 */
1368
-				if( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1368
+				if ( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1369 1369
 					continue;
1370 1370
 				}
1371 1371
 
@@ -1394,7 +1394,7 @@  discard block
 block discarded – undo
1394 1394
 					 * @param \GV\View The View.
1395 1395
 					 */
1396 1396
 					$js_dependency = apply_filters( 'gravityview_lightbox_script', $js_dependency, $view );
1397
-					$js_dependencies[] = $js_dependency;
1397
+					$js_dependencies[ ] = $js_dependency;
1398 1398
 
1399 1399
 					/**
1400 1400
 					 * @filter `gravity_view_lightbox_style` Modify the lightbox CSS slug. Default: `thickbox`
@@ -1410,7 +1410,7 @@  discard block
 block discarded – undo
1410 1410
 					 * @param \GV\View The View.
1411 1411
 					 */
1412 1412
 					$css_dependency = apply_filters( 'gravityview_lightbox_style', $css_dependency, $view );
1413
-					$css_dependencies[] = $css_dependency;
1413
+					$css_dependencies[ ] = $css_dependency;
1414 1414
 				}
1415 1415
 
1416 1416
 				/**
@@ -1418,19 +1418,19 @@  discard block
 block discarded – undo
1418 1418
 				 * @see https://github.com/katzwebservices/GravityView/issues/536
1419 1419
 				 * @since 1.15
1420 1420
 				 */
1421
-				if( gravityview_view_has_single_checkbox_or_radio( $data['form'], $data['fields'] ) ) {
1422
-					$css_dependencies[] = 'dashicons';
1421
+				if ( gravityview_view_has_single_checkbox_or_radio( $data[ 'form' ], $data[ 'fields' ] ) ) {
1422
+					$css_dependencies[ ] = 'dashicons';
1423 1423
 				}
1424 1424
 
1425 1425
 				wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true );
1426 1426
 
1427 1427
 				$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1428 1428
 
1429
-				wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ) , GravityView_Plugin::version, true );
1429
+				wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ), GravityView_Plugin::version, true );
1430 1430
 
1431 1431
 				wp_enqueue_script( 'gravityview-fe-view' );
1432 1432
 
1433
-				if ( ! empty( $data['atts']['sort_columns'] ) ) {
1433
+				if ( ! empty( $data[ 'atts' ][ 'sort_columns' ] ) ) {
1434 1434
 					wp_enqueue_style( 'gravityview_font', plugins_url( 'assets/css/font.css', GRAVITYVIEW_FILE ), $css_dependencies, GravityView_Plugin::version, 'all' );
1435 1435
 				}
1436 1436
 
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
 	public static function add_style( $template_id ) {
1494 1494
 
1495 1495
 		if ( ! empty( $template_id ) && wp_style_is( 'gravityview_style_' . $template_id, 'registered' ) ) {
1496
-			gravityview()->log->debug(  'Adding extra template style for {template_id}', array( 'template_id' => $template_id ) );
1496
+			gravityview()->log->debug( 'Adding extra template style for {template_id}', array( 'template_id' => $template_id ) );
1497 1497
 			wp_enqueue_style( 'gravityview_style_' . $template_id );
1498 1498
 		} elseif ( empty( $template_id ) ) {
1499 1499
 			gravityview()->log->error( 'Cannot add template style; template_id is empty' );
@@ -1524,11 +1524,11 @@  discard block
 block discarded – undo
1524 1524
 		 * Not a table-based template; don't add sort icons
1525 1525
 		 * @since 1.12
1526 1526
 		 */
1527
-		if( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1527
+		if ( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1528 1528
 			return $label;
1529 1529
 		}
1530 1530
 
1531
-		if ( ! $this->is_field_sortable( $field['id'], $form ) ) {
1531
+		if ( ! $this->is_field_sortable( $field[ 'id' ], $form ) ) {
1532 1532
 			return $label;
1533 1533
 		}
1534 1534
 
@@ -1536,29 +1536,29 @@  discard block
 block discarded – undo
1536 1536
 
1537 1537
 		$class = 'gv-sort';
1538 1538
 
1539
-		$sort_field_id = self::_override_sorting_id_by_field_type( $field['id'], $form['id'] );
1539
+		$sort_field_id = self::_override_sorting_id_by_field_type( $field[ 'id' ], $form[ 'id' ] );
1540 1540
 
1541 1541
 		$sort_args = array(
1542
-			'sort' => $field['id'],
1542
+			'sort' => $field[ 'id' ],
1543 1543
 			'dir' => 'asc',
1544 1544
 		);
1545 1545
 
1546
-		if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) {
1546
+		if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) {
1547 1547
 			//toggle sorting direction.
1548
-			if ( 'asc' === $sorting['direction'] ) {
1549
-				$sort_args['dir'] = 'desc';
1548
+			if ( 'asc' === $sorting[ 'direction' ] ) {
1549
+				$sort_args[ 'dir' ] = 'desc';
1550 1550
 				$class .= ' gv-icon-sort-desc';
1551 1551
 			} else {
1552
-				$sort_args['dir'] = 'asc';
1552
+				$sort_args[ 'dir' ] = 'asc';
1553 1553
 				$class .= ' gv-icon-sort-asc';
1554 1554
 			}
1555 1555
 		} else {
1556 1556
 			$class .= ' gv-icon-caret-up-down';
1557 1557
 		}
1558 1558
 
1559
-		$url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) );
1559
+		$url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) );
1560 1560
 
1561
-		return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a>&nbsp;'. $label;
1561
+		return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a>&nbsp;' . $label;
1562 1562
 
1563 1563
 	}
1564 1564
 
@@ -1576,7 +1576,7 @@  discard block
 block discarded – undo
1576 1576
 
1577 1577
 		$field_type = $field_id;
1578 1578
 
1579
-		if( is_numeric( $field_id ) ) {
1579
+		if ( is_numeric( $field_id ) ) {
1580 1580
 			$field = GFFormsModel::get_field( $form, $field_id );
1581 1581
 			$field_type = $field ? $field->type : $field_id;
1582 1582
 		}
@@ -1599,7 +1599,7 @@  discard block
 block discarded – undo
1599 1599
 			return false;
1600 1600
 		}
1601 1601
 
1602
-		return apply_filters( "gravityview/sortable/formfield_{$form['id']}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1602
+		return apply_filters( "gravityview/sortable/formfield_{$form[ 'id' ]}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1603 1603
 
1604 1604
 	}
1605 1605
 
Please login to merge, or discard this patch.