Completed
Push — develop ( 3edd81...936044 )
by Zack
16:26
created
includes/extensions/delete-entry/class-delete-entry.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 
43 43
 		add_action( 'wp', array( $this, 'process_delete' ), 10000 );
44 44
 
45
-		add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field'), 10, 3 );
45
+		add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field' ), 10, 3 );
46 46
 
47 47
 		add_action( 'gravityview_before', array( $this, 'display_message' ) );
48 48
 
49 49
 		// For the Delete Entry Link, you don't want visible to all users.
50
-		add_filter( 'gravityview_field_visibility_caps', array( $this, 'modify_visibility_caps'), 10, 5 );
50
+		add_filter( 'gravityview_field_visibility_caps', array( $this, 'modify_visibility_caps' ), 10, 5 );
51 51
 
52 52
 		// Modify the field options based on the name of the field type
53 53
 		add_filter( 'gravityview_template_delete_link_options', array( $this, 'delete_link_field_options' ), 10, 5 );
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 		// add template path to check for field
56 56
 		add_filter( 'gravityview_template_paths', array( $this, 'add_template_path' ) );
57 57
 
58
-		add_action( 'gravityview/edit-entry/publishing-action/after', array( $this, 'add_delete_button'), 10, 4 );
58
+		add_action( 'gravityview/edit-entry/publishing-action/after', array( $this, 'add_delete_button' ), 10, 4 );
59 59
 
60
-		add_action ( 'gravityview/delete-entry/deleted', array( $this, 'process_connected_posts' ), 10, 2 );
61
-		add_action ( 'gravityview/delete-entry/trashed', array( $this, 'process_connected_posts' ), 10, 2 );
60
+		add_action( 'gravityview/delete-entry/deleted', array( $this, 'process_connected_posts' ), 10, 2 );
61
+		add_action( 'gravityview/delete-entry/trashed', array( $this, 'process_connected_posts' ), 10, 2 );
62 62
 	}
63 63
 
64 64
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	static function getInstance() {
71 71
 
72
-		if( empty( self::$instance ) ) {
72
+		if ( empty( self::$instance ) ) {
73 73
 			self::$instance = new self;
74 74
 		}
75 75
 
@@ -105,20 +105,20 @@  discard block
 block discarded – undo
105 105
 	function delete_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
106 106
 
107 107
 		// Always a link, never a filter
108
-		unset( $field_options['show_as_link'], $field_options['search_filter'] );
108
+		unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ] );
109 109
 
110 110
 		// Delete Entry link should only appear to visitors capable of editing entries
111
-		unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] );
111
+		unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] );
112 112
 
113
-		$add_option['delete_link'] = array(
113
+		$add_option[ 'delete_link' ] = array(
114 114
 			'type' => 'text',
115 115
 			'label' => __( 'Delete Link Text', 'gravityview' ),
116 116
 			'desc' => NULL,
117
-			'value' => __('Delete Entry', 'gravityview'),
117
+			'value' => __( 'Delete Entry', 'gravityview' ),
118 118
 			'merge_tags' => true,
119 119
 		);
120 120
 
121
-		$field_options['allow_edit_cap'] = array(
121
+		$field_options[ 'allow_edit_cap' ] = array(
122 122
 			'type' => 'select',
123 123
 			'label' => __( 'Allow the following users to delete the entry:', 'gravityview' ),
124 124
 			'choices' => GravityView_Render_Settings::get_cap_choices( $template_id, $field_id, $context, $input_type ),
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) {
144 144
 
145
-		if( 'edit' !== $zone ) {
146
-			$entry_default_fields['delete_link'] = array(
145
+		if ( 'edit' !== $zone ) {
146
+			$entry_default_fields[ 'delete_link' ] = array(
147 147
 				'label' => __( 'Delete Entry', 'gravityview' ),
148 148
 				'type'  => 'delete_link',
149 149
 				'desc'  => __( 'A link to delete the entry. Respects the Delete Entry permissions.', 'gravityview' ),
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 */
161 161
 	function add_available_field( $available_fields = array() ) {
162 162
 
163
-		$available_fields['delete_link'] = array(
163
+		$available_fields[ 'delete_link' ] = array(
164 164
 			'label_text' => __( 'Delete Entry', 'gravityview' ),
165 165
 			'field_id' => 'delete_link',
166 166
 			'label_type' => 'field',
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
 		$caps = $visibility_caps;
189 189
 
190 190
 		// If we're configuring fields in the edit context, we want a limited selection
191
-		if( $field_id === 'delete_link' ) {
191
+		if ( $field_id === 'delete_link' ) {
192 192
 
193 193
 			// Remove other built-in caps.
194
-			unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] );
194
+			unset( $caps[ 'publish_posts' ], $caps[ 'gravityforms_view_entries' ], $caps[ 'delete_others_posts' ] );
195 195
 
196
-			$caps['read'] = _x('Entry Creator', 'User capability', 'gravityview');
196
+			$caps[ 'read' ] = _x( 'Entry Creator', 'User capability', 'gravityview' );
197 197
 		}
198 198
 
199 199
 		return $caps;
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	 * @param [type] $entry [description]
207 207
 	 */
208 208
 	function set_entry( $entry = null ) {
209
-		$this->entry = empty( $entry ) ? GravityView_View::getInstance()->entries[0] : $entry;
209
+		$this->entry = empty( $entry ) ? GravityView_View::getInstance()->entries[ 0 ] : $entry;
210 210
 	}
211 211
 
212 212
 	/**
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
 		self::getInstance()->set_entry( $entry );
241 241
 
242
-        $base = GravityView_API::directory_link( $post_id ? : $view_id, true );
242
+        $base = GravityView_API::directory_link( $post_id ?: $view_id, true );
243 243
 
244 244
 		if ( empty( $base ) ) {
245 245
 			gravityview()->log->error( 'Post ID does not exist: {post_id}', array( 'post_id' => $post_id ) );
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 		}
248 248
 
249 249
 		// Use the slug instead of the ID for consistent security
250
-		$entry_slug = GravityView_API::get_entry_slug( $entry['id'], $entry );
250
+		$entry_slug = GravityView_API::get_entry_slug( $entry[ 'id' ], $entry );
251 251
 
252 252
 		$actionurl = add_query_arg( array(
253 253
 			'action'	=> 'delete',
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
             'view_id' => $view_id,
257 257
 		), $base );
258 258
 
259
-		$url = wp_nonce_url( $actionurl, 'delete_'.$entry_slug, 'delete' );
259
+		$url = wp_nonce_url( $actionurl, 'delete_' . $entry_slug, 'delete' );
260 260
 
261 261
 		return $url;
262 262
 	}
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	public function add_delete_button( $form = array(), $entry = array(), $view_id = null, $post_id = null ) {
279 279
 
280 280
 		// Only show the link to those who are allowed to see it.
281
-		if( !self::check_user_cap_delete_entry( $entry, array(), $view_id ) ) {
281
+		if ( ! self::check_user_cap_delete_entry( $entry, array(), $view_id ) ) {
282 282
 			return;
283 283
 		}
284 284
 
@@ -289,13 +289,13 @@  discard block
 block discarded – undo
289 289
 		$show_delete_button = apply_filters( 'gravityview/delete-entry/show-delete-button', true );
290 290
 
291 291
 		// If the button is hidden by the filter, don't show.
292
-		if( !$show_delete_button ) {
292
+		if ( ! $show_delete_button ) {
293 293
 			return;
294 294
 		}
295 295
 
296 296
 		$attributes = array(
297 297
 			'class' => 'btn btn-sm button button-small alignright pull-right btn-danger gv-button-delete',
298
-			'tabindex' => ( GFCommon::$tab_index ++ ),
298
+			'tabindex' => ( GFCommon::$tab_index++ ),
299 299
 			'onclick' => self::get_confirm_dialog(),
300 300
 		);
301 301
 
@@ -319,27 +319,27 @@  discard block
 block discarded – undo
319 319
 	function process_delete() {
320 320
 
321 321
 		// If the form is submitted
322
-		if( isset( $_GET['action'] ) && 'delete' === $_GET['action'] && isset( $_GET['entry_id'] ) ) {
322
+		if ( isset( $_GET[ 'action' ] ) && 'delete' === $_GET[ 'action' ] && isset( $_GET[ 'entry_id' ] ) ) {
323 323
 
324 324
 			// Make sure it's a GravityView request
325
-			$valid_nonce_key = wp_verify_nonce( $_GET['delete'], self::get_nonce_key( $_GET['entry_id'] ) );
325
+			$valid_nonce_key = wp_verify_nonce( $_GET[ 'delete' ], self::get_nonce_key( $_GET[ 'entry_id' ] ) );
326 326
 
327
-			if( ! $valid_nonce_key ) {
327
+			if ( ! $valid_nonce_key ) {
328 328
 				gravityview()->log->debug( 'Delete entry not processed: nonce validation failed.' );
329 329
 				return;
330 330
 			}
331 331
 
332 332
 			// Get the entry slug
333
-			$entry_slug = esc_attr( $_GET['entry_id'] );
333
+			$entry_slug = esc_attr( $_GET[ 'entry_id' ] );
334 334
 
335 335
 			// See if there's an entry there
336 336
 			$entry = gravityview_get_entry( $entry_slug, true, false );
337 337
 
338
-			if( $entry ) {
338
+			if ( $entry ) {
339 339
 
340 340
 				$has_permission = $this->user_can_delete_entry( $entry );
341 341
 
342
-				if( is_wp_error( $has_permission ) ) {
342
+				if ( is_wp_error( $has_permission ) ) {
343 343
 
344 344
 					$messages = array(
345 345
 						'message' => urlencode( $has_permission->get_error_message() ),
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 					// Delete the entry
352 352
 					$delete_response = $this->delete_or_trash_entry( $entry );
353 353
 
354
-					if( is_wp_error( $delete_response ) ) {
354
+					if ( is_wp_error( $delete_response ) ) {
355 355
 
356 356
 						$messages = array(
357 357
 							'message' => urlencode( $delete_response->get_error_message() ),
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 				gravityview()->log->debug( 'Delete entry failed: there was no entry with the entry slug {entry_slug}', array( 'entry_slug' => $entry_slug ) );
374 374
 
375 375
 				$messages = array(
376
-					'message' => urlencode( __('The entry does not exist.', 'gravityview') ),
376
+					'message' => urlencode( __( 'The entry does not exist.', 'gravityview' ) ),
377 377
 					'status' => 'error',
378 378
 				);
379 379
 			}
@@ -413,18 +413,18 @@  discard block
 block discarded – undo
413 413
 	 */
414 414
 	private function delete_or_trash_entry( $entry ) {
415 415
 
416
-		$entry_id = $entry['id'];
416
+		$entry_id = $entry[ 'id' ];
417 417
 		
418 418
 		$mode = $this->get_delete_mode();
419 419
 
420
-		if( 'delete' === $mode ) {
420
+		if ( 'delete' === $mode ) {
421 421
 
422 422
 			gravityview()->log->debug( 'Starting delete entry: {entry_id}', array( 'entry_id' => $entry_id ) );
423 423
 
424 424
 			// Delete the entry
425 425
 			$delete_response = GFAPI::delete_entry( $entry_id );
426 426
 
427
-			if( ! is_wp_error( $delete_response ) ) {
427
+			if ( ! is_wp_error( $delete_response ) ) {
428 428
 				$delete_response = 'deleted';
429 429
 
430 430
 				/**
@@ -445,8 +445,8 @@  discard block
 block discarded – undo
445 445
 			$trashed = GFAPI::update_entry_property( $entry_id, 'status', 'trash' );
446 446
 			new GravityView_Cache;
447 447
 
448
-			if( ! $trashed ) {
449
-				$delete_response = new WP_Error( 'trash_entry_failed', __('Moving the entry to the trash failed.', 'gravityview' ) );
448
+			if ( ! $trashed ) {
449
+				$delete_response = new WP_Error( 'trash_entry_failed', __( 'Moving the entry to the trash failed.', 'gravityview' ) );
450 450
 			} else {
451 451
 
452 452
 				/**
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 	public function process_connected_posts( $entry_id = 0, $entry = array() ) {
478 478
 
479 479
 		// The entry had no connected post
480
-		if( empty( $entry['post_id'] ) ) {
480
+		if ( empty( $entry[ 'post_id' ] ) ) {
481 481
 			return;
482 482
 		}
483 483
 
@@ -488,19 +488,19 @@  discard block
 block discarded – undo
488 488
 		 */
489 489
 		$delete_post = apply_filters( 'gravityview/delete-entry/delete-connected-post', true );
490 490
 		
491
-		if( false === $delete_post ) {
491
+		if ( false === $delete_post ) {
492 492
 			return;
493 493
 		}
494 494
 
495 495
 		$action = current_action();
496 496
 
497
-		if( 'gravityview/delete-entry/deleted' === $action ) {
498
-			$result = wp_delete_post( $entry['post_id'], true );
497
+		if ( 'gravityview/delete-entry/deleted' === $action ) {
498
+			$result = wp_delete_post( $entry[ 'post_id' ], true );
499 499
 		} else {
500
-			$result = wp_trash_post( $entry['post_id'] );
500
+			$result = wp_trash_post( $entry[ 'post_id' ] );
501 501
 		}
502 502
 
503
-		if( false === $result ) {
503
+		if ( false === $result ) {
504 504
 			gravityview()->log->error( '(called by {action}): Error processing the Post connected to the entry.', array( 'action' => $action, 'data' => $entry ) );
505 505
 		} else {
506 506
 			gravityview()->log->debug( '(called by {action}): Successfully processed Post connected to the entry.', array( 'action' => $action, 'data' => $entry ) );
@@ -516,13 +516,13 @@  discard block
 block discarded – undo
516 516
 	public function verify_nonce() {
517 517
 
518 518
 		// No delete entry request was made
519
-		if( empty( $_GET['entry_id'] ) || empty( $_GET['delete'] ) ) {
519
+		if ( empty( $_GET[ 'entry_id' ] ) || empty( $_GET[ 'delete' ] ) ) {
520 520
 			return false;
521 521
 		}
522 522
 
523
-		$nonce_key = self::get_nonce_key( $_GET['entry_id'] );
523
+		$nonce_key = self::get_nonce_key( $_GET[ 'entry_id' ] );
524 524
 
525
-		$valid = wp_verify_nonce( $_GET['delete'], $nonce_key );
525
+		$valid = wp_verify_nonce( $_GET[ 'delete' ], $nonce_key );
526 526
 
527 527
 		/**
528 528
 		 * @filter `gravityview/delete-entry/verify_nonce` Override Delete Entry nonce validation. Return true to declare nonce valid.
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 	 */
545 545
 	public static function get_confirm_dialog() {
546 546
 
547
-		$confirm = __('Are you sure you want to delete this entry? This cannot be undone.', 'gravityview');
547
+		$confirm = __( 'Are you sure you want to delete this entry? This cannot be undone.', 'gravityview' );
548 548
 
549 549
 		/**
550 550
 		 * @filter `gravityview/delete-entry/confirm-text` Modify the Delete Entry Javascript confirmation text
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 		 */
553 553
 		$confirm = apply_filters( 'gravityview/delete-entry/confirm-text', $confirm );
554 554
 
555
-		return 'return window.confirm(\''. esc_js( $confirm ) .'\');';
555
+		return 'return window.confirm(\'' . esc_js( $confirm ) . '\');';
556 556
 	}
557 557
 
558 558
 	/**
@@ -570,16 +570,16 @@  discard block
 block discarded – undo
570 570
 
571 571
 		$error = NULL;
572 572
 
573
-		if( ! $this->verify_nonce() ) {
574
-			$error = __( 'The link to delete this entry is not valid; it may have expired.', 'gravityview');
573
+		if ( ! $this->verify_nonce() ) {
574
+			$error = __( 'The link to delete this entry is not valid; it may have expired.', 'gravityview' );
575 575
 		}
576 576
 
577
-		if( ! self::check_user_cap_delete_entry( $entry, array(), $view_id ) ) {
578
-			$error = __( 'You do not have permission to delete this entry.', 'gravityview');
577
+		if ( ! self::check_user_cap_delete_entry( $entry, array(), $view_id ) ) {
578
+			$error = __( 'You do not have permission to delete this entry.', 'gravityview' );
579 579
 		}
580 580
 
581
-		if( $entry['status'] === 'trash' ) {
582
-			if( 'trash' === $this->get_delete_mode() ) {
581
+		if ( $entry[ 'status' ] === 'trash' ) {
582
+			if ( 'trash' === $this->get_delete_mode() ) {
583 583
 				$error = __( 'The entry is already in the trash.', 'gravityview' );
584 584
 			} else {
585 585
 				$error = __( 'You cannot delete the entry; it is already in the trash.', 'gravityview' );
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 		}
588 588
 
589 589
 		// No errors; everything's fine here!
590
-		if( empty( $error ) ) {
590
+		if ( empty( $error ) ) {
591 591
 			return true;
592 592
 		}
593 593
 
@@ -616,10 +616,10 @@  discard block
 block discarded – undo
616 616
 
617 617
 		$current_user = wp_get_current_user();
618 618
 
619
-		$entry_id = isset( $entry['id'] ) ? $entry['id'] : NULL;
619
+		$entry_id = isset( $entry[ 'id' ] ) ? $entry[ 'id' ] : NULL;
620 620
 
621 621
 		// Or if they can delete any entries (as defined in Gravity Forms), we're good.
622
-		if( GVCommon::has_cap( array( 'gravityforms_delete_entries', 'gravityview_delete_others_entries' ), $entry_id ) ) {
622
+		if ( GVCommon::has_cap( array( 'gravityforms_delete_entries', 'gravityview_delete_others_entries' ), $entry_id ) ) {
623 623
 
624 624
 			gravityview()->log->debug( 'Current user has `gravityforms_delete_entries` or `gravityview_delete_others_entries` capability.' );
625 625
 
@@ -628,20 +628,20 @@  discard block
 block discarded – undo
628 628
 
629 629
 
630 630
 		// If field options are passed, check if current user can view the link
631
-		if( !empty( $field ) ) {
631
+		if ( ! empty( $field ) ) {
632 632
 
633 633
 			// If capability is not defined, something is not right!
634
-			if( empty( $field['allow_edit_cap'] ) ) {
634
+			if ( empty( $field[ 'allow_edit_cap' ] ) ) {
635 635
 
636 636
 				gravityview()->log->error( 'Cannot read delete entry field caps', array( 'data' => $field ) );
637 637
 
638 638
 				return false;
639 639
 			}
640 640
 
641
-			if( GVCommon::has_cap( $field['allow_edit_cap'] ) ) {
641
+			if ( GVCommon::has_cap( $field[ 'allow_edit_cap' ] ) ) {
642 642
 
643 643
 				// Do not return true if cap is read, as we need to check if the current user created the entry
644
-				if( $field['allow_edit_cap'] !== 'read' ) {
644
+				if ( $field[ 'allow_edit_cap' ] !== 'read' ) {
645 645
 					return true;
646 646
 				}
647 647
 
@@ -654,21 +654,21 @@  discard block
 block discarded – undo
654 654
 
655 655
 		}
656 656
 
657
-		if( !isset( $entry['created_by'] ) ) {
657
+		if ( ! isset( $entry[ 'created_by' ] ) ) {
658 658
 
659
-			gravityview()->log->error( 'Entry `created_by` doesn\'t exist.');
659
+			gravityview()->log->error( 'Entry `created_by` doesn\'t exist.' );
660 660
 
661 661
 			return false;
662 662
 		}
663 663
 
664 664
 		// Only checks user_delete view option if view is already set
665
-		if( $view_id ) {
665
+		if ( $view_id ) {
666 666
 
667 667
 			$current_view = gravityview_get_current_view_data( $view_id );
668 668
 
669
-			$user_delete = isset( $current_view['atts']['user_delete'] ) ? $current_view['atts']['user_delete'] : false;
669
+			$user_delete = isset( $current_view[ 'atts' ][ 'user_delete' ] ) ? $current_view[ 'atts' ][ 'user_delete' ] : false;
670 670
 
671
-			if( empty( $user_delete ) ) {
671
+			if ( empty( $user_delete ) ) {
672 672
 
673 673
 				gravityview()->log->debug( 'User Delete is disabled. Returning false.' );
674 674
 
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 		}
678 678
 
679 679
 		// If the logged-in user is the same as the user who created the entry, we're good.
680
-		if( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry['created_by'] ) ) {
680
+		if ( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry[ 'created_by' ] ) ) {
681 681
 
682 682
 			gravityview()->log->debug( 'User {user_id} created the entry.', array( 'user_id' => $current_user->ID ) );
683 683
 
@@ -702,16 +702,16 @@  discard block
 block discarded – undo
702 702
 	 */
703 703
 	public function display_message( $current_view_id = 0 ) {
704 704
 
705
-		if( empty( $_GET['status'] ) || ! self::verify_nonce() ) {
705
+		if ( empty( $_GET[ 'status' ] ) || ! self::verify_nonce() ) {
706 706
 			return;
707 707
 		}
708 708
 
709 709
 		// Entry wasn't deleted from current View
710
-		if( isset( $_GET['view_id'] ) && intval( $_GET['view_id'] ) !== intval( $current_view_id ) ) {
710
+		if ( isset( $_GET[ 'view_id' ] ) && intval( $_GET[ 'view_id' ] ) !== intval( $current_view_id ) ) {
711 711
 			return;
712 712
 		}
713 713
 
714
-		$status = esc_attr( $_GET['status'] );
714
+		$status = esc_attr( $_GET[ 'status' ] );
715 715
 		$message_from_url = \GV\Utils::_GET( 'message' );
716 716
 		$message_from_url = rawurldecode( stripslashes_deep( $message_from_url ) );
717 717
 		$class = '';
@@ -719,14 +719,14 @@  discard block
 block discarded – undo
719 719
 		switch ( $status ) {
720 720
 			case 'error':
721 721
 				$class = ' gv-error error';
722
-				$error_message = __('There was an error deleting the entry: %s', 'gravityview');
722
+				$error_message = __( 'There was an error deleting the entry: %s', 'gravityview' );
723 723
 				$message = sprintf( $error_message, $message_from_url );
724 724
 				break;
725 725
 			case 'trashed':
726
-				$message = __('The entry was successfully moved to the trash.', 'gravityview');
726
+				$message = __( 'The entry was successfully moved to the trash.', 'gravityview' );
727 727
 				break;
728 728
 			default:
729
-				$message = __('The entry was successfully deleted.', 'gravityview');
729
+				$message = __( 'The entry was successfully deleted.', 'gravityview' );
730 730
 				break;
731 731
 		}
732 732
 
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 		$message = apply_filters( 'gravityview/delete-entry/message', esc_attr( $message ), $status, $message_from_url );
741 741
 
742 742
 		// DISPLAY ERROR/SUCCESS MESSAGE
743
-		echo '<div class="gv-notice' . esc_attr( $class ) .'">'. $message .'</div>';
743
+		echo '<div class="gv-notice' . esc_attr( $class ) . '">' . $message . '</div>';
744 744
 	}
745 745
 
746 746
 
Please login to merge, or discard this patch.
includes/class-gravityview-migrate.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 		$disapproved_result = $wpdb->query( $wpdb->prepare( $sql, GravityView_Entry_Approval_Status::DISAPPROVED, '0' ) );
74 74
 
75
-		if( false === $approved_result || false === $disapproved_result ) {
75
+		if ( false === $approved_result || false === $disapproved_result ) {
76 76
 			gravityview()->log->error( 'There was an error processing the query. {error}', array( 'error' => $wpdb->last_error ) );
77 77
 		} else {
78 78
 			// All done: Meta values are migrated
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
 		$redux_settings = $this->get_redux_settings();
106 106
 
107 107
 		// No need to process
108
-		if( false === $redux_settings ) {
108
+		if ( false === $redux_settings ) {
109 109
 			return;
110 110
 		}
111 111
 
112
-		if( empty(  $redux_settings['license_key_status'] ) ) {
112
+		if ( empty( $redux_settings[ 'license_key_status' ] ) ) {
113 113
 			$redux_settings = $this->get_redux_license_status( $redux_settings );
114 114
 		}
115 115
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 		gravityview()->plugin->settings->update( $updated_settings );
124 124
 
125 125
 		// And now remove the previous option, so this is a one-time thing.
126
-		delete_option('gravityview_settings');
127
-		delete_option('gravityview_settings-transients');
126
+		delete_option( 'gravityview_settings' );
127
+		delete_option( 'gravityview_settings-transients' );
128 128
 	}
129 129
 
130 130
 	/**
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 
148 148
 		$license_call = \GV\License_Handler::get()->license_call( $data );
149 149
 
150
-		if( is_object( $license_call ) && isset( $license_call->license ) ) {
151
-			$redux_settings['license_key_status'] = $license_call->license;
152
-			$redux_settings['license_key_response'] = json_encode( $license_call );
150
+		if ( is_object( $license_call ) && isset( $license_call->license ) ) {
151
+			$redux_settings[ 'license_key_status' ] = $license_call->license;
152
+			$redux_settings[ 'license_key_response' ] = json_encode( $license_call );
153 153
 		}
154 154
 
155 155
 		return $redux_settings;
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
 	function get_redux_settings() {
164 164
 
165 165
 		// Previous settings set by Redux
166
-		$redux_option = get_option('gravityview_settings');
166
+		$redux_option = get_option( 'gravityview_settings' );
167 167
 
168 168
 		// No Redux settings? Don't proceed.
169
-		if( false === $redux_option ) {
169
+		if ( false === $redux_option ) {
170 170
 			return false;
171 171
 		}
172 172
 
@@ -178,19 +178,19 @@  discard block
 block discarded – undo
178 178
 
179 179
 		if ( $license_array = \GV\Utils::get( $redux_option, 'license' ) ) {
180 180
 
181
-			$redux_settings['license_key'] = $license_key = \GV\Utils::get( $license_array, 'license' );
181
+			$redux_settings[ 'license_key' ] = $license_key = \GV\Utils::get( $license_array, 'license' );
182 182
 
183
-			$redux_last_changed_values = get_option('gravityview_settings-transients');
183
+			$redux_last_changed_values = get_option( 'gravityview_settings-transients' );
184 184
 
185 185
 			// This contains the last response for license validation
186
-			if( !empty( $redux_last_changed_values ) && $saved_values = \GV\Utils::get( $redux_last_changed_values, 'changed_values' ) ) {
186
+			if ( ! empty( $redux_last_changed_values ) && $saved_values = \GV\Utils::get( $redux_last_changed_values, 'changed_values' ) ) {
187 187
 
188 188
 				$saved_license = \GV\Utils::get( $saved_values, 'license' );
189 189
 
190 190
 				// Only use the last-saved values if they are for the same license
191
-				if( $saved_license && \GV\Utils::get( $saved_license, 'license' ) === $license_key ) {
192
-					$redux_settings['license_key_status'] = \GV\Utils::get( $saved_license, 'status' );
193
-					$redux_settings['license_key_response'] = \GV\Utils::get( $saved_license, 'response' );
191
+				if ( $saved_license && \GV\Utils::get( $saved_license, 'license' ) === $license_key ) {
192
+					$redux_settings[ 'license_key_status' ] = \GV\Utils::get( $saved_license, 'status' );
193
+					$redux_settings[ 'license_key_response' ] = \GV\Utils::get( $saved_license, 'response' );
194 194
 				}
195 195
 			}
196 196
 		}
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
 	/** ----  Migrate from old search widget to new search widget  ---- */
203 203
 	function update_search_on_views() {
204 204
 
205
-		if( !class_exists('GravityView_Widget_Search') ) {
206
-			include_once( GRAVITYVIEW_DIR .'includes/extensions/search-widget/class-search-widget.php' );
205
+		if ( ! class_exists( 'GravityView_Widget_Search' ) ) {
206
+			include_once( GRAVITYVIEW_DIR . 'includes/extensions/search-widget/class-search-widget.php' );
207 207
 		}
208 208
 
209 209
 		// Loop through all the views
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
 
216 216
 		$views = get_posts( $query_args );
217 217
 
218
-		foreach( $views as $view ) {
218
+		foreach ( $views as $view ) {
219 219
 
220 220
 			$widgets = gravityview_get_directory_widgets( $view->ID );
221 221
 			$search_fields = null;
222 222
 
223
-			if( empty( $widgets ) || !is_array( $widgets ) ) { continue; }
223
+			if ( empty( $widgets ) || ! is_array( $widgets ) ) { continue; }
224 224
 
225 225
 			gravityview()->log->debug( '[GravityView_Migrate/update_search_on_views] Loading View ID: {view_id}', array( 'view_id' => $view->ID ) );
226 226
 
227
-			foreach( $widgets as $area => $ws ) {
228
-				foreach( $ws as $k => $widget ) {
229
-					if( $widget['id'] !== 'search_bar' ) { continue; }
227
+			foreach ( $widgets as $area => $ws ) {
228
+				foreach ( $ws as $k => $widget ) {
229
+					if ( $widget[ 'id' ] !== 'search_bar' ) { continue; }
230 230
 
231
-					if( is_null( $search_fields ) ) {
231
+					if ( is_null( $search_fields ) ) {
232 232
 						$search_fields = $this->get_search_fields( $view->ID );
233 233
 					}
234 234
 
@@ -236,24 +236,24 @@  discard block
 block discarded – undo
236 236
 					//  [search_free] => 1
237 237
 			        //  [search_date] => 1
238 238
 			        $search_generic = array();
239
-					if( !empty( $widget['search_free'] ) ) {
240
-						$search_generic[] = array( 'field' => 'search_all', 'input' => 'input_text' );
239
+					if ( ! empty( $widget[ 'search_free' ] ) ) {
240
+						$search_generic[ ] = array( 'field' => 'search_all', 'input' => 'input_text' );
241 241
 					}
242
-					if( !empty( $widget['search_date'] ) ) {
243
-						$search_generic[] = array( 'field' => 'entry_date', 'input' => 'date' );
242
+					if ( ! empty( $widget[ 'search_date' ] ) ) {
243
+						$search_generic[ ] = array( 'field' => 'entry_date', 'input' => 'date' );
244 244
 					}
245 245
 
246 246
 					$search_config = array_merge( $search_generic, $search_fields );
247 247
 
248 248
 					// don't throw '[]' when json_encode an empty array
249
-					if( empty( $search_config ) ) {
249
+					if ( empty( $search_config ) ) {
250 250
 						$search_config = '';
251 251
 					} else {
252 252
 						$search_config = json_encode( $search_config );
253 253
 					}
254 254
 
255
-					$widgets[ $area ][ $k ]['search_fields'] = $search_config;
256
-					$widgets[ $area ][ $k ]['search_layout'] = 'horizontal';
255
+					$widgets[ $area ][ $k ][ 'search_fields' ] = $search_config;
256
+					$widgets[ $area ][ $k ][ 'search_layout' ] = 'horizontal';
257 257
 
258 258
 					gravityview()->log->debug( '[GravityView_Migrate/update_search_on_views] Updated Widget: ', array( 'data' => $widgets[ $area ][ $k ] ) );
259 259
 				}
@@ -281,26 +281,26 @@  discard block
 block discarded – undo
281 281
 		// check view fields' settings
282 282
 		$fields = gravityview_get_directory_fields( $view_id, false );
283 283
 
284
-		if( !empty( $fields ) && is_array( $fields ) ) {
284
+		if ( ! empty( $fields ) && is_array( $fields ) ) {
285 285
 
286
-			foreach( $fields as $t => $fs ) {
286
+			foreach ( $fields as $t => $fs ) {
287 287
 
288
-				foreach( $fs as $k => $field ) {
288
+				foreach ( $fs as $k => $field ) {
289 289
 					// is field a search_filter ?
290
-					if( empty( $field['search_filter'] ) ) { continue; }
290
+					if ( empty( $field[ 'search_filter' ] ) ) { continue; }
291 291
 
292 292
 					// get field type & calculate the input type (by default)
293
-					$form_field = gravityview_get_field( $form, $field['id'] );
293
+					$form_field = gravityview_get_field( $form, $field[ 'id' ] );
294 294
 
295
-					if( empty( $form_field['type'] ) ) {
295
+					if ( empty( $form_field[ 'type' ] ) ) {
296 296
 						continue;
297 297
 					}
298 298
 
299 299
 					// depending on the field type assign a group of possible search field types
300
-					$type = GravityView_Widget_Search::get_search_input_types( $field['id'], $form_field['type'] );
300
+					$type = GravityView_Widget_Search::get_search_input_types( $field[ 'id' ], $form_field[ 'type' ] );
301 301
 
302 302
 					// add field to config
303
-					$search_fields[] = array( 'field' => $field['id'], 'input' => $type );
303
+					$search_fields[ ] = array( 'field' => $field[ 'id' ], 'input' => $type );
304 304
 
305 305
 				}
306 306
 			}
Please login to merge, or discard this patch.
includes/class-common.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 
126 126
 		$form = false;
127 127
 
128
-		if( $entry ) {
129
-			$form = GFAPI::get_form( $entry['form_id'] );
128
+		if ( $entry ) {
129
+			$form = GFAPI::get_form( $entry[ 'form_id' ] );
130 130
 		}
131 131
 
132 132
 		return $form;
@@ -192,12 +192,12 @@  discard block
 block discarded – undo
192 192
 
193 193
 			$has_transaction_data = \GV\Utils::get( $entry, $meta, false );
194 194
 
195
-			if( ! empty( $has_transaction_data ) ) {
195
+			if ( ! empty( $has_transaction_data ) ) {
196 196
 				break;
197 197
 			}
198 198
 		}
199 199
 
200
-		return (bool) $has_transaction_data;
200
+		return (bool)$has_transaction_data;
201 201
 	}
202 202
 
203 203
 	/**
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
 		$results = GFAPI::get_entries( intval( $form_id ), $search_criteria, null, $paging );
237 237
 
238
-		$result = ( ! empty( $results ) && ! empty( $results[0]['id'] ) ) ? $results[0]['id'] : null;
238
+		$result = ( ! empty( $results ) && ! empty( $results[ 0 ][ 'id' ] ) ) ? $results[ 0 ][ 'id' ] : null;
239 239
 
240 240
 		return $result;
241 241
 	}
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
 	 *
253 253
 	 * @return array Empty array if GFAPI class isn't available or no forms. Otherwise, the array of Forms
254 254
 	 */
255
-	public static function get_forms(  $active = true, $trash = false ) {
255
+	public static function get_forms( $active = true, $trash = false ) {
256 256
 		$forms = array();
257 257
 		if ( class_exists( 'GFAPI' ) ) {
258
-			if( 'any' === $active ) {
258
+			if ( 'any' === $active ) {
259 259
 				$active_forms = GFAPI::get_forms( true, $trash );
260 260
 				$inactive_forms = GFAPI::get_forms( false, $trash );
261 261
 				$forms = array_merge( array_filter( $active_forms ), array_filter( $inactive_forms ) );
@@ -286,9 +286,9 @@  discard block
 block discarded – undo
286 286
 		$has_post_fields = false;
287 287
 
288 288
 		if ( $form ) {
289
-			foreach ( $form['fields'] as $field ) {
290
-				if ( $include_parent_field || empty( $field['inputs'] ) ) {
291
-					$fields["{$field['id']}"] = array(
289
+			foreach ( $form[ 'fields' ] as $field ) {
290
+				if ( $include_parent_field || empty( $field[ 'inputs' ] ) ) {
291
+					$fields[ "{$field[ 'id' ]}" ] = array(
292 292
 						'label' => \GV\Utils::get( $field, 'label' ),
293 293
 						'parent' => null,
294 294
 						'type' => \GV\Utils::get( $field, 'type' ),
@@ -297,10 +297,10 @@  discard block
 block discarded – undo
297 297
 					);
298 298
 				}
299 299
 
300
-				if ( $add_default_properties && ! empty( $field['inputs'] ) ) {
301
-					foreach ( $field['inputs'] as $input ) {
300
+				if ( $add_default_properties && ! empty( $field[ 'inputs' ] ) ) {
301
+					foreach ( $field[ 'inputs' ] as $input ) {
302 302
 
303
-						if( ! empty( $input['isHidden'] ) ) {
303
+						if ( ! empty( $input[ 'isHidden' ] ) ) {
304 304
 							continue;
305 305
 						}
306 306
 
@@ -308,10 +308,10 @@  discard block
 block discarded – undo
308 308
                          * @hack
309 309
                          * In case of email/email confirmation, the input for email has the same id as the parent field
310 310
                          */
311
-						if( 'email' === $field['type'] && false === strpos( $input['id'], '.' ) ) {
311
+						if ( 'email' === $field[ 'type' ] && false === strpos( $input[ 'id' ], '.' ) ) {
312 312
                             continue;
313 313
                         }
314
-						$fields["{$input['id']}"] = array(
314
+						$fields[ "{$input[ 'id' ]}" ] = array(
315 315
 							'label' => \GV\Utils::get( $input, 'label' ),
316 316
 							'customLabel' => \GV\Utils::get( $input, 'customLabel' ),
317 317
 							'parent' => $field,
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 				}
324 324
 
325 325
 
326
-				if( GFCommon::is_product_field( $field['type'] ) ){
326
+				if ( GFCommon::is_product_field( $field[ 'type' ] ) ) {
327 327
 					$has_product_fields = true;
328 328
 				}
329 329
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		 * @since 1.7
338 338
 		 */
339 339
 		if ( $has_post_fields ) {
340
-			$fields['post_id'] = array(
340
+			$fields[ 'post_id' ] = array(
341 341
 				'label' => __( 'Post ID', 'gravityview' ),
342 342
 				'type' => 'post_id',
343 343
 			);
@@ -350,11 +350,11 @@  discard block
 block discarded – undo
350 350
 			foreach ( $payment_fields as $payment_field ) {
351 351
 
352 352
 				// Either the field exists ($fields['shipping']) or the form explicitly contains a `shipping` field with numeric key
353
-				if( isset( $fields["{$payment_field->name}"] ) || GFCommon::get_fields_by_type( $form, $payment_field->name ) ) {
353
+				if ( isset( $fields[ "{$payment_field->name}" ] ) || GFCommon::get_fields_by_type( $form, $payment_field->name ) ) {
354 354
 					continue;
355 355
 				}
356 356
 
357
-				$fields["{$payment_field->name}"] = array(
357
+				$fields[ "{$payment_field->name}" ] = array(
358 358
 					'label' => $payment_field->label,
359 359
 					'desc' => $payment_field->description,
360 360
 					'type' => $payment_field->name,
@@ -386,9 +386,9 @@  discard block
 block discarded – undo
386 386
 
387 387
 		$fields = array();
388 388
 
389
-		foreach ( $extra_fields as $key => $field ){
390
-			if ( ! empty( $only_default_column ) && ! empty( $field['is_default_column'] ) ) {
391
-				$fields[ $key ] = array( 'label' => $field['label'], 'type' => 'entry_meta' );
389
+		foreach ( $extra_fields as $key => $field ) {
390
+			if ( ! empty( $only_default_column ) && ! empty( $field[ 'is_default_column' ] ) ) {
391
+				$fields[ $key ] = array( 'label' => $field[ 'label' ], 'type' => 'entry_meta' );
392 392
 			}
393 393
 		}
394 394
 
@@ -428,33 +428,33 @@  discard block
 block discarded – undo
428 428
 			'search_criteria' => null,
429 429
 			'sorting' => null,
430 430
 			'paging' => null,
431
-			'cache' => (isset( $passed_criteria['cache'] ) ? (bool) $passed_criteria['cache'] : true),
431
+			'cache' => ( isset( $passed_criteria[ 'cache' ] ) ? (bool)$passed_criteria[ 'cache' ] : true ),
432 432
 			'context_view_id' => null,
433 433
 		);
434 434
 
435 435
 		$criteria = wp_parse_args( $passed_criteria, $search_criteria_defaults );
436 436
 
437
-		if ( ! empty( $criteria['search_criteria']['field_filters'] ) ) {
438
-			foreach ( $criteria['search_criteria']['field_filters'] as &$filter ) {
437
+		if ( ! empty( $criteria[ 'search_criteria' ][ 'field_filters' ] ) ) {
438
+			foreach ( $criteria[ 'search_criteria' ][ 'field_filters' ] as &$filter ) {
439 439
 
440 440
 				if ( ! is_array( $filter ) ) {
441 441
 					continue;
442 442
 				}
443 443
 
444 444
 				// By default, we want searches to be wildcard for each field.
445
-				$filter['operator'] = empty( $filter['operator'] ) ? 'contains' : $filter['operator'];
445
+				$filter[ 'operator' ] = empty( $filter[ 'operator' ] ) ? 'contains' : $filter[ 'operator' ];
446 446
 
447 447
 				/**
448 448
 				 * @filter `gravityview_search_operator` Modify the search operator for the field (contains, is, isnot, etc)
449 449
 				 * @param string $operator Existing search operator
450 450
 				 * @param array $filter array with `key`, `value`, `operator`, `type` keys
451 451
 				 */
452
-				$filter['operator'] = apply_filters( 'gravityview_search_operator', $filter['operator'], $filter );
452
+				$filter[ 'operator' ] = apply_filters( 'gravityview_search_operator', $filter[ 'operator' ], $filter );
453 453
 			}
454 454
 
455 455
 			// don't send just the [mode] without any field filter.
456
-			if( count( $criteria['search_criteria']['field_filters'] ) === 1 && array_key_exists( 'mode' , $criteria['search_criteria']['field_filters'] ) ) {
457
-				unset( $criteria['search_criteria']['field_filters']['mode'] );
456
+			if ( count( $criteria[ 'search_criteria' ][ 'field_filters' ] ) === 1 && array_key_exists( 'mode', $criteria[ 'search_criteria' ][ 'field_filters' ] ) ) {
457
+				unset( $criteria[ 'search_criteria' ][ 'field_filters' ][ 'mode' ] );
458 458
 			}
459 459
 
460 460
 		}
@@ -465,33 +465,33 @@  discard block
 block discarded – undo
465 465
 		 * Prepare date formats to be in Gravity Forms DB format;
466 466
 		 * $passed_criteria may include date formats incompatible with Gravity Forms.
467 467
 		 */
468
-		foreach ( array('start_date', 'end_date' ) as $key ) {
468
+		foreach ( array( 'start_date', 'end_date' ) as $key ) {
469 469
 
470
-			if ( ! empty( $criteria['search_criteria'][ $key ] ) ) {
470
+			if ( ! empty( $criteria[ 'search_criteria' ][ $key ] ) ) {
471 471
 
472 472
 				// Use date_create instead of new DateTime so it returns false if invalid date format.
473
-				$date = date_create( $criteria['search_criteria'][ $key ] );
473
+				$date = date_create( $criteria[ 'search_criteria' ][ $key ] );
474 474
 
475 475
 				if ( $date ) {
476 476
 					// Gravity Forms wants dates in the `Y-m-d H:i:s` format.
477
-					$criteria['search_criteria'][ $key ] = $date->format( 'Y-m-d H:i:s' );
477
+					$criteria[ 'search_criteria' ][ $key ] = $date->format( 'Y-m-d H:i:s' );
478 478
 				} else {
479
-					gravityview()->log->error( '{key} Date format not valid:', array( 'key' => $key, $criteria['search_criteria'][ $key ] ) );
479
+					gravityview()->log->error( '{key} Date format not valid:', array( 'key' => $key, $criteria[ 'search_criteria' ][ $key ] ) );
480 480
 
481 481
 					// If it's an invalid date, unset it. Gravity Forms freaks out otherwise.
482
-					unset( $criteria['search_criteria'][ $key ] );
482
+					unset( $criteria[ 'search_criteria' ][ $key ] );
483 483
 				}
484 484
 			}
485 485
 		}
486 486
 
487
-		if ( empty( $criteria['context_view_id'] ) ) {
487
+		if ( empty( $criteria[ 'context_view_id' ] ) ) {
488 488
 			// Calculate the context view id and send it to the advanced filter
489 489
 			if ( GravityView_frontend::getInstance()->getSingleEntry() ) {
490
-				$criteria['context_view_id'] = GravityView_frontend::getInstance()->get_context_view_id();
490
+				$criteria[ 'context_view_id' ] = GravityView_frontend::getInstance()->get_context_view_id();
491 491
 			} else if ( class_exists( 'GravityView_View_Data' ) && GravityView_View_Data::getInstance() && GravityView_View_Data::getInstance()->has_multiple_views() ) {
492
-				$criteria['context_view_id'] = GravityView_frontend::getInstance()->get_context_view_id();
492
+				$criteria[ 'context_view_id' ] = GravityView_frontend::getInstance()->get_context_view_id();
493 493
 			} else if ( 'delete' === GFForms::get( 'action' ) ) {
494
-				$criteria['context_view_id'] = isset( $_GET['view_id'] ) ? intval( $_GET['view_id'] ) : null;
494
+				$criteria[ 'context_view_id' ] = isset( $_GET[ 'view_id' ] ) ? intval( $_GET[ 'view_id' ] ) : null;
495 495
 			}
496 496
 		}
497 497
 
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 		 * @param array $form_ids Forms to search
502 502
 		 * @param int $view_id ID of the view being used to search
503 503
 		 */
504
-		$criteria = apply_filters( 'gravityview_search_criteria', $criteria, $form_ids, $criteria['context_view_id'] );
504
+		$criteria = apply_filters( 'gravityview_search_criteria', $criteria, $form_ids, $criteria[ 'context_view_id' ] );
505 505
 
506 506
 		return (array)$criteria;
507 507
 	}
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 		/** Reduce # of database calls */
532 532
 		add_filter( 'gform_is_encrypted_field', '__return_false' );
533 533
 
534
-		if ( ! empty( $criteria['cache'] ) ) {
534
+		if ( ! empty( $criteria[ 'cache' ] ) ) {
535 535
 
536 536
 			$Cache = new GravityView_Cache( $form_ids, $criteria );
537 537
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 
540 540
 				// Still update the total count when using cached results
541 541
 				if ( ! is_null( $total ) ) {
542
-					$total = GFAPI::count_entries( $form_ids, $criteria['search_criteria'] );
542
+					$total = GFAPI::count_entries( $form_ids, $criteria[ 'search_criteria' ] );
543 543
 				}
544 544
 
545 545
 				$return = $entries;
@@ -560,9 +560,9 @@  discard block
 block discarded – undo
560 560
 			$entries = apply_filters( 'gravityview_before_get_entries', null, $criteria, $passed_criteria, $total );
561 561
 
562 562
 			// No entries returned from gravityview_before_get_entries
563
-			if( is_null( $entries ) ) {
563
+			if ( is_null( $entries ) ) {
564 564
 
565
-				$entries = GFAPI::get_entries( $form_ids, $criteria['search_criteria'], $criteria['sorting'], $criteria['paging'], $total );
565
+				$entries = GFAPI::get_entries( $form_ids, $criteria[ 'search_criteria' ], $criteria[ 'sorting' ], $criteria[ 'paging' ], $total );
566 566
 
567 567
 				if ( is_wp_error( $entries ) ) {
568 568
 					gravityview()->log->error( '{error}', array( 'error' => $entries->get_error_message(), 'data' => $entries ) );
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 				}
574 574
 			}
575 575
 
576
-			if ( ! empty( $criteria['cache'] ) && isset( $Cache ) ) {
576
+			if ( ! empty( $criteria[ 'cache' ] ) && isset( $Cache ) ) {
577 577
 
578 578
 				// Cache results
579 579
 				$Cache->set( $entries, 'entries' );
@@ -680,12 +680,12 @@  discard block
 block discarded – undo
680 680
 		 */
681 681
 		$check_entry_display = apply_filters( 'gravityview/common/get_entry/check_entry_display', $check_entry_display, $entry );
682 682
 
683
-		if( $check_entry_display ) {
683
+		if ( $check_entry_display ) {
684 684
 			// Is the entry allowed
685 685
 			$entry = self::check_entry_display( $entry );
686 686
 		}
687 687
 
688
-		if( is_wp_error( $entry ) ) {
688
+		if ( is_wp_error( $entry ) ) {
689 689
 			gravityview()->log->error( '{error}', array( 'error' => $entry->get_error_message() ) );
690 690
 			return false;
691 691
 		}
@@ -719,12 +719,12 @@  discard block
 block discarded – undo
719 719
 
720 720
 		$value = false;
721 721
 
722
-		if( 'context' === $val1 ) {
722
+		if ( 'context' === $val1 ) {
723 723
 
724 724
 			$matching_contexts = array( $val2 );
725 725
 
726 726
 			// We allow for non-standard contexts.
727
-			switch( $val2 ) {
727
+			switch ( $val2 ) {
728 728
 				// Check for either single or edit
729 729
 				case 'singular':
730 730
 					$matching_contexts = array( 'single', 'edit' );
@@ -767,18 +767,18 @@  discard block
 block discarded – undo
767 767
 				$json_val_1 = json_decode( $val1, true );
768 768
 				$json_val_2 = json_decode( $val2, true );
769 769
 
770
-				if( ! empty( $json_val_1 ) || ! empty( $json_val_2 ) ) {
770
+				if ( ! empty( $json_val_1 ) || ! empty( $json_val_2 ) ) {
771 771
 
772 772
 					$json_in = false;
773
-					$json_val_1 = $json_val_1 ? (array) $json_val_1 : array( $val1 );
774
-					$json_val_2 = $json_val_2 ? (array) $json_val_2 : array( $val2 );
773
+					$json_val_1 = $json_val_1 ? (array)$json_val_1 : array( $val1 );
774
+					$json_val_2 = $json_val_2 ? (array)$json_val_2 : array( $val2 );
775 775
 
776 776
 					// For JSON, we want to compare as "in" or "not in" rather than "contains"
777 777
 					foreach ( $json_val_1 as $item_1 ) {
778 778
 						foreach ( $json_val_2 as $item_2 ) {
779 779
 							$json_in = self::matches_operation( $item_1, $item_2, 'is' );
780 780
 
781
-							if( $json_in ) {
781
+							if ( $json_in ) {
782 782
 								break 2;
783 783
 							}
784 784
 						}
@@ -826,64 +826,64 @@  discard block
 block discarded – undo
826 826
 	public static function check_entry_display( $entry ) {
827 827
 
828 828
 		if ( ! $entry || is_wp_error( $entry ) ) {
829
-			return new WP_Error('entry_not_found', 'Entry was not found.', $entry );
829
+			return new WP_Error( 'entry_not_found', 'Entry was not found.', $entry );
830 830
 		}
831 831
 
832
-		if ( empty( $entry['form_id'] ) ) {
832
+		if ( empty( $entry[ 'form_id' ] ) ) {
833 833
 			return new WP_Error( 'form_id_not_set', '[apply_filters_to_entry] Entry is empty!', $entry );
834 834
 		}
835 835
 
836 836
 		$criteria = self::calculate_get_entries_criteria();
837 837
 
838
-		if ( empty( $criteria['search_criteria'] ) || ! is_array( $criteria['search_criteria'] ) ) {
838
+		if ( empty( $criteria[ 'search_criteria' ] ) || ! is_array( $criteria[ 'search_criteria' ] ) ) {
839 839
 			gravityview()->log->debug( '[apply_filters_to_entry] Entry approved! No search criteria found:', array( 'data' => $criteria ) );
840 840
 			return $entry;
841 841
 		}
842 842
 
843 843
 		// Make sure the current View is connected to the same form as the Entry
844
-		if( ! empty( $criteria['context_view_id'] ) ) {
845
-			$context_view_id = intval( $criteria['context_view_id'] );
844
+		if ( ! empty( $criteria[ 'context_view_id' ] ) ) {
845
+			$context_view_id = intval( $criteria[ 'context_view_id' ] );
846 846
 			$context_form_id = gravityview_get_form_id( $context_view_id );
847
-			if( intval( $context_form_id ) !== intval( $entry['form_id'] ) ) {
848
-				return new WP_Error( 'view_id_not_match', sprintf( '[apply_filters_to_entry] Entry form ID does not match current View connected form ID:', $entry['form_id'] ), $criteria['context_view_id'] );
847
+			if ( intval( $context_form_id ) !== intval( $entry[ 'form_id' ] ) ) {
848
+				return new WP_Error( 'view_id_not_match', sprintf( '[apply_filters_to_entry] Entry form ID does not match current View connected form ID:', $entry[ 'form_id' ] ), $criteria[ 'context_view_id' ] );
849 849
 			}
850 850
 		}
851 851
 
852
-		$search_criteria = $criteria['search_criteria'];
852
+		$search_criteria = $criteria[ 'search_criteria' ];
853 853
 
854 854
 		// check entry status
855
-		if ( array_key_exists( 'status', $search_criteria ) && $search_criteria['status'] != $entry['status'] ) {
856
-			return new WP_Error( 'status_not_valid', sprintf( '[apply_filters_to_entry] Entry status - %s - is not valid according to filter:', $entry['status'] ), $search_criteria );
855
+		if ( array_key_exists( 'status', $search_criteria ) && $search_criteria[ 'status' ] != $entry[ 'status' ] ) {
856
+			return new WP_Error( 'status_not_valid', sprintf( '[apply_filters_to_entry] Entry status - %s - is not valid according to filter:', $entry[ 'status' ] ), $search_criteria );
857 857
 		}
858 858
 
859 859
 		// check entry date
860 860
 		// @todo: Does it make sense to apply the Date create filters to the single entry?
861 861
 
862 862
 		// field_filters
863
-		if ( empty( $search_criteria['field_filters'] ) || ! is_array( $search_criteria['field_filters'] ) ) {
863
+		if ( empty( $search_criteria[ 'field_filters' ] ) || ! is_array( $search_criteria[ 'field_filters' ] ) ) {
864 864
 			gravityview()->log->debug( '[apply_filters_to_entry] Entry approved! No field filters criteria found:', array( 'data' => $search_criteria ) );
865 865
 			return $entry;
866 866
 		}
867 867
 
868
-		$filters = $search_criteria['field_filters'];
868
+		$filters = $search_criteria[ 'field_filters' ];
869 869
 
870
-		$mode = array_key_exists( 'mode', $filters ) ? strtolower( $filters['mode'] ) : 'all';
870
+		$mode = array_key_exists( 'mode', $filters ) ? strtolower( $filters[ 'mode' ] ) : 'all';
871 871
 
872
-		$mode = $mode ? : 'all'; // If mode is an empty string, assume it's 'all'
872
+		$mode = $mode ?: 'all'; // If mode is an empty string, assume it's 'all'
873 873
 
874 874
 		// Prevent the mode from being processed below
875
-		unset( $filters['mode'] );
875
+		unset( $filters[ 'mode' ] );
876 876
 
877
-		$form = self::get_form( $entry['form_id'] );
877
+		$form = self::get_form( $entry[ 'form_id' ] );
878 878
 
879 879
 		foreach ( $filters as $filter ) {
880 880
 
881
-			if ( ! isset( $filter['key'] ) ) {
881
+			if ( ! isset( $filter[ 'key' ] ) ) {
882 882
 				gravityview()->log->debug( '[apply_filters_to_entry] Filter key not set: {filter}', array( 'filter' => $filter ) );
883 883
 				continue;
884 884
 			}
885 885
 
886
-			$k = $filter['key'];
886
+			$k = $filter[ 'key' ];
887 887
 
888 888
 			$field = self::get_field( $form, $k );
889 889
 
@@ -891,14 +891,14 @@  discard block
 block discarded – undo
891 891
 				$field_value = isset( $entry[ $k ] ) ? $entry[ $k ] : null;
892 892
 				$field = $k;
893 893
 			} else {
894
-				$field_value  = GFFormsModel::get_lead_field_value( $entry, $field );
894
+				$field_value = GFFormsModel::get_lead_field_value( $entry, $field );
895 895
 				 // If it's a complex field, then fetch the input's value, if exists at the current key. Otherwise, let GF handle it
896 896
 				$field_value = ( is_array( $field_value ) && isset( $field_value[ $k ] ) ) ? \GV\Utils::get( $field_value, $k ) : $field_value;
897 897
 			}
898 898
 
899
-			$operator = isset( $filter['operator'] ) ? strtolower( $filter['operator'] ) : 'is';
899
+			$operator = isset( $filter[ 'operator' ] ) ? strtolower( $filter[ 'operator' ] ) : 'is';
900 900
 
901
-			$is_value_match = GravityView_GFFormsModel::is_value_match( $field_value, $filter['value'], $operator, $field );
901
+			$is_value_match = GravityView_GFFormsModel::is_value_match( $field_value, $filter[ 'value' ], $operator, $field );
902 902
 
903 903
 			// Any match is all we need to know
904 904
 			if ( $is_value_match && 'any' === $mode ) {
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
 
908 908
 			// Any failed match is a total fail
909 909
 			if ( ! $is_value_match && 'all' === $mode ) {
910
-				return new WP_Error('failed_criteria', '[apply_filters_to_entry] Entry cannot be displayed. Failed a criterium for ALL mode', $filter );
910
+				return new WP_Error( 'failed_criteria', '[apply_filters_to_entry] Entry cannot be displayed. Failed a criterium for ALL mode', $filter );
911 911
 			}
912 912
 		}
913 913
 
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 			gravityview()->log->debug( '[apply_filters_to_entry] Entry approved: all conditions were met' );
918 918
 			return $entry;
919 919
 		} else {
920
-			return new WP_Error('failed_any_criteria', '[apply_filters_to_entry] Entry cannot be displayed. Failed all the criteria for ANY mode', $filters );
920
+			return new WP_Error( 'failed_any_criteria', '[apply_filters_to_entry] Entry cannot be displayed. Failed all the criteria for ANY mode', $filters );
921 921
 		}
922 922
 
923 923
 	}
@@ -958,18 +958,18 @@  discard block
 block discarded – undo
958 958
 		 * Gravity Forms code to adjust date to locally-configured Time Zone
959 959
 		 * @see GFCommon::format_date() for original code
960 960
 		 */
961
-		$date_gmt_time   = mysql2date( 'G', $date_string );
961
+		$date_gmt_time = mysql2date( 'G', $date_string );
962 962
 		$date_local_timestamp = GFCommon::get_local_timestamp( $date_gmt_time );
963 963
 
964
-		$format  = \GV\Utils::get( $atts, 'format' );
965
-		$is_human  = ! empty( $atts['human'] );
966
-		$is_diff  = ! empty( $atts['diff'] );
967
-		$is_raw = ! empty( $atts['raw'] );
968
-		$is_timestamp = ! empty( $atts['timestamp'] );
969
-		$include_time = ! empty( $atts['time'] );
964
+		$format = \GV\Utils::get( $atts, 'format' );
965
+		$is_human = ! empty( $atts[ 'human' ] );
966
+		$is_diff = ! empty( $atts[ 'diff' ] );
967
+		$is_raw = ! empty( $atts[ 'raw' ] );
968
+		$is_timestamp = ! empty( $atts[ 'timestamp' ] );
969
+		$include_time = ! empty( $atts[ 'time' ] );
970 970
 
971 971
 		// If we're using time diff, we want to have a different default format
972
-		if( empty( $format ) ) {
972
+		if ( empty( $format ) ) {
973 973
 			/* translators: %s: relative time from now, used for generic date comparisons. "1 day ago", or "20 seconds ago" */
974 974
 			$format = $is_diff ? esc_html__( '%s ago', 'gravityview' ) : get_option( 'date_format' );
975 975
 		}
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
 		// If raw was specified, don't modify the stored value
978 978
 		if ( $is_raw ) {
979 979
 			$formatted_date = $date_string;
980
-		} elseif( $is_timestamp ) {
980
+		} elseif ( $is_timestamp ) {
981 981
 			$formatted_date = $date_local_timestamp;
982 982
 		} elseif ( $is_diff ) {
983 983
 			$formatted_date = sprintf( $format, human_time_diff( $date_gmt_time ) );
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
 
1012 1012
 		$label = \GV\Utils::get( $field, 'label' );
1013 1013
 
1014
-		if( floor( $field_id ) !== floatval( $field_id ) ) {
1014
+		if ( floor( $field_id ) !== floatval( $field_id ) ) {
1015 1015
 			$label = GFFormsModel::get_choice_text( $field, $field_value, $field_id );
1016 1016
 		}
1017 1017
 
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
 			$form = GFAPI::get_form( $form );
1040 1040
 		}
1041 1041
 
1042
-		if ( class_exists( 'GFFormsModel' ) ){
1042
+		if ( class_exists( 'GFFormsModel' ) ) {
1043 1043
 			return GFFormsModel::get_field( $form, $field_id );
1044 1044
 		} else {
1045 1045
 			return null;
@@ -1086,19 +1086,19 @@  discard block
 block discarded – undo
1086 1086
 			$shortcodes = array();
1087 1087
 
1088 1088
 			preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
1089
-			if ( empty( $matches ) ){
1089
+			if ( empty( $matches ) ) {
1090 1090
 				return false;
1091 1091
 			}
1092 1092
 
1093 1093
 			foreach ( $matches as $shortcode ) {
1094
-				if ( $tag === $shortcode[2] ) {
1094
+				if ( $tag === $shortcode[ 2 ] ) {
1095 1095
 
1096 1096
 					// Changed this to $shortcode instead of true so we get the parsed atts.
1097
-					$shortcodes[] = $shortcode;
1097
+					$shortcodes[ ] = $shortcode;
1098 1098
 
1099
-				} else if ( isset( $shortcode[5] ) && $results = self::has_shortcode_r( $shortcode[5], $tag ) ) {
1100
-					foreach( $results as $result ) {
1101
-						$shortcodes[] = $result;
1099
+				} else if ( isset( $shortcode[ 5 ] ) && $results = self::has_shortcode_r( $shortcode[ 5 ], $tag ) ) {
1100
+					foreach ( $results as $result ) {
1101
+						$shortcodes[ ] = $result;
1102 1102
 					}
1103 1103
 				}
1104 1104
 			}
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
 			'post_type'      => 'gravityview',
1131 1131
 			'posts_per_page' => 100,
1132 1132
 			'meta_key'       => '_gravityview_form_id',
1133
-			'meta_value'     => (int) $form_id,
1133
+			'meta_value'     => (int)$form_id,
1134 1134
 		);
1135 1135
 		$args     = wp_parse_args( $args, $defaults );
1136 1136
 		$views    = get_posts( $args );
@@ -1142,21 +1142,21 @@  discard block
 block discarded – undo
1142 1142
 
1143 1143
 			$data = unserialize( $view->meta_value );
1144 1144
 
1145
-			if( ! $data || ! is_array( $data ) ) {
1145
+			if ( ! $data || ! is_array( $data ) ) {
1146 1146
 				continue;
1147 1147
 			}
1148 1148
 
1149 1149
 			foreach ( $data as $datum ) {
1150
-				if ( ! empty( $datum[2] ) && (int) $datum[2] === (int) $form_id ) {
1151
-					$joined_forms[] = $view->post_id;
1150
+				if ( ! empty( $datum[ 2 ] ) && (int)$datum[ 2 ] === (int)$form_id ) {
1151
+					$joined_forms[ ] = $view->post_id;
1152 1152
 				}
1153 1153
 			}
1154 1154
 		}
1155 1155
 
1156 1156
 		if ( $joined_forms ) {
1157
-			$joined_args  = array(
1157
+			$joined_args = array(
1158 1158
 				'post_type'      => 'gravityview',
1159
-				'posts_per_page' => $args['posts_per_page'],
1159
+				'posts_per_page' => $args[ 'posts_per_page' ],
1160 1160
 				'post__in'       => $joined_forms,
1161 1161
 			);
1162 1162
 			$views = array_merge( $views, get_posts( $joined_args ) );
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
 
1313 1313
 		$directory_widgets = wp_parse_args( $view_widgets, $defaults );
1314 1314
 
1315
-		if( $json_decode ) {
1315
+		if ( $json_decode ) {
1316 1316
 			$directory_widgets = gv_map_deep( $directory_widgets, 'gv_maybe_json_decode' );
1317 1317
 		}
1318 1318
 
@@ -1328,7 +1328,7 @@  discard block
 block discarded – undo
1328 1328
 	 * @return string         html
1329 1329
 	 */
1330 1330
 	public static function get_sortable_fields( $formid, $current = '' ) {
1331
-		$output = '<option value="" ' . selected( '', $current, false ).'>' . esc_html__( 'Default', 'gravityview' ) .'</option>';
1331
+		$output = '<option value="" ' . selected( '', $current, false ) . '>' . esc_html__( 'Default', 'gravityview' ) . '</option>';
1332 1332
 
1333 1333
 		if ( empty( $formid ) ) {
1334 1334
 			return $output;
@@ -1341,11 +1341,11 @@  discard block
 block discarded – undo
1341 1341
 			$blacklist_field_types = apply_filters( 'gravityview_blacklist_field_types', array( 'list', 'textarea' ), null );
1342 1342
 
1343 1343
 			foreach ( $fields as $id => $field ) {
1344
-				if ( in_array( $field['type'], $blacklist_field_types ) ) {
1344
+				if ( in_array( $field[ 'type' ], $blacklist_field_types ) ) {
1345 1345
 					continue;
1346 1346
 				}
1347 1347
 
1348
-				$output .= '<option value="'. $id .'" '. selected( $id, $current, false ).'>'. esc_attr( $field['label'] ) .'</option>';
1348
+				$output .= '<option value="' . $id . '" ' . selected( $id, $current, false ) . '>' . esc_attr( $field[ 'label' ] ) . '</option>';
1349 1349
 			}
1350 1350
 		}
1351 1351
 
@@ -1380,9 +1380,9 @@  discard block
 block discarded – undo
1380 1380
 		$blacklist_field_types = apply_filters( 'gravityview_blacklist_field_types', $blacklist, NULL );
1381 1381
 
1382 1382
 		// TODO: Convert to using array_filter
1383
-		foreach( $fields as $id => $field ) {
1383
+		foreach ( $fields as $id => $field ) {
1384 1384
 
1385
-			if( in_array( $field['type'], $blacklist_field_types ) ) {
1385
+			if ( in_array( $field[ 'type' ], $blacklist_field_types ) ) {
1386 1386
 				unset( $fields[ $id ] );
1387 1387
 			}
1388 1388
 		}
@@ -1423,14 +1423,14 @@  discard block
 block discarded – undo
1423 1423
 	 * @param  int|array  $field field key or field array
1424 1424
 	 * @return boolean
1425 1425
 	 */
1426
-	public static function is_field_numeric(  $form = null, $field = '' ) {
1426
+	public static function is_field_numeric( $form = null, $field = '' ) {
1427 1427
 
1428 1428
 		if ( ! is_array( $form ) && ! is_array( $field ) ) {
1429 1429
 			$form = self::get_form( $form );
1430 1430
 		}
1431 1431
 
1432 1432
 		// If entry meta, it's a string. Otherwise, numeric
1433
-		if( ! is_numeric( $field ) && is_string( $field ) ) {
1433
+		if ( ! is_numeric( $field ) && is_string( $field ) ) {
1434 1434
 			$type = $field;
1435 1435
 		} else {
1436 1436
 			$type = self::get_field_type( $form, $field );
@@ -1444,9 +1444,9 @@  discard block
 block discarded – undo
1444 1444
 		$numeric_types = apply_filters( 'gravityview/common/numeric_types', array( 'number', 'time' ) );
1445 1445
 
1446 1446
 		// Defer to GravityView_Field setting, if the field type is registered and `is_numeric` is true
1447
-		if( $gv_field = GravityView_Fields::get( $type ) ) {
1448
-			if( true === $gv_field->is_numeric ) {
1449
-				$numeric_types[] = $gv_field->is_numeric;
1447
+		if ( $gv_field = GravityView_Fields::get( $type ) ) {
1448
+			if ( true === $gv_field->is_numeric ) {
1449
+				$numeric_types[ ] = $gv_field->is_numeric;
1450 1450
 			}
1451 1451
 		}
1452 1452
 
@@ -1596,18 +1596,18 @@  discard block
 block discarded – undo
1596 1596
 		$final_atts = array_filter( $final_atts );
1597 1597
 
1598 1598
 		// If the href wasn't passed as an attribute, use the value passed to the function
1599
-		if ( empty( $final_atts['href'] ) && ! empty( $href ) ) {
1600
-			$final_atts['href'] = $href;
1599
+		if ( empty( $final_atts[ 'href' ] ) && ! empty( $href ) ) {
1600
+			$final_atts[ 'href' ] = $href;
1601 1601
 		}
1602 1602
 
1603
-		$final_atts['href'] = esc_url_raw( $href );
1603
+		$final_atts[ 'href' ] = esc_url_raw( $href );
1604 1604
 
1605 1605
 		/**
1606 1606
 		 * Fix potential security issue with target=_blank
1607 1607
 		 * @see https://dev.to/ben/the-targetblank-vulnerability-by-example
1608 1608
 		 */
1609
-		if( '_blank' === \GV\Utils::get( $final_atts, 'target' ) ) {
1610
-			$final_atts['rel'] = trim( \GV\Utils::get( $final_atts, 'rel', '' ) . ' noopener noreferrer' );
1609
+		if ( '_blank' === \GV\Utils::get( $final_atts, 'target' ) ) {
1610
+			$final_atts[ 'rel' ] = trim( \GV\Utils::get( $final_atts, 'rel', '' ) . ' noopener noreferrer' );
1611 1611
 		}
1612 1612
 
1613 1613
 		// Sort the attributes alphabetically, to help testing
@@ -1619,7 +1619,7 @@  discard block
 block discarded – undo
1619 1619
 			$output .= sprintf( ' %s="%s"', $attr, esc_attr( $value ) );
1620 1620
 		}
1621 1621
 
1622
-		if( '' !== $output ) {
1622
+		if ( '' !== $output ) {
1623 1623
 			$output = '<a' . $output . '>' . $anchor_text . '</a>';
1624 1624
 		}
1625 1625
 
@@ -1646,7 +1646,7 @@  discard block
 block discarded – undo
1646 1646
 			if ( is_array( $value ) && isset( $merged[ $key ] ) && is_array( $merged[ $key ] ) ) {
1647 1647
 				$merged[ $key ] = self::array_merge_recursive_distinct( $merged[ $key ], $value );
1648 1648
 			} else if ( is_numeric( $key ) && isset( $merged[ $key ] ) ) {
1649
-				$merged[] = $value;
1649
+				$merged[ ] = $value;
1650 1650
 			} else {
1651 1651
 				$merged[ $key ] = $value;
1652 1652
 			}
@@ -1679,7 +1679,7 @@  discard block
 block discarded – undo
1679 1679
 		 * `$context` is where are we using this information (e.g. change_entry_creator, search_widget ..)
1680 1680
 		 * @param array $settings Settings array, with `number` key defining the # of users to display
1681 1681
 		 */
1682
-		$get_users_settings = apply_filters( 'gravityview/get_users/'. $context, apply_filters( 'gravityview_change_entry_creator_user_parameters', $get_users_settings ) );
1682
+		$get_users_settings = apply_filters( 'gravityview/get_users/' . $context, apply_filters( 'gravityview_change_entry_creator_user_parameters', $get_users_settings ) );
1683 1683
 
1684 1684
 		return get_users( $get_users_settings );
1685 1685
 	}
@@ -1699,11 +1699,11 @@  discard block
 block discarded – undo
1699 1699
     public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) {
1700 1700
 
1701 1701
     	// If $cap is defined, only show notice if user has capability
1702
-    	if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) {
1702
+    	if ( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) {
1703 1703
     		return '';
1704 1704
 	    }
1705 1705
 
1706
-        return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>';
1706
+        return '<div class="gv-notice ' . gravityview_sanitize_html_class( $class ) . '">' . $notice . '</div>';
1707 1707
     }
1708 1708
 
1709 1709
 	/**
Please login to merge, or discard this patch.
includes/class-gravityview-gfformsmodel.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -40,15 +40,15 @@  discard block
 block discarded – undo
40 40
 	public static function is_value_match( $field_value, $target_value, $operation = 'is', $source_field = null, $rule = null, $form = null ) {
41 41
 
42 42
 		if ( 'date_created' === $source_field ) {
43
-			$field_value = is_int( $field_value )? $field_value : strtotime( $field_value );
44
-			$target_value = is_int( $target_value )? $target_value : strtotime( $target_value );
43
+			$field_value = is_int( $field_value ) ? $field_value : strtotime( $field_value );
44
+			$target_value = is_int( $target_value ) ? $target_value : strtotime( $target_value );
45 45
 		}
46 46
 
47 47
 		if ( in_array( $operation, array( 'in', 'not_in' ) ) ) {
48
-			return GVCommon::matches_operation( (array) $field_value, (array) $target_value, $operation );
48
+			return GVCommon::matches_operation( (array)$field_value, (array)$target_value, $operation );
49 49
 		}
50 50
 
51
-		return parent::is_value_match( (array) $field_value, $target_value, $operation, $source_field, $rule, $form );
51
+		return parent::is_value_match( (array)$field_value, $target_value, $operation, $source_field, $rule, $form );
52 52
 	}
53 53
 
54 54
 	/**
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
 
70 70
         $post_data = self::get_post_fields( $form, $entry );
71 71
 
72
-        $media = get_attached_media( 'image', $entry['post_id'] );
72
+        $media = get_attached_media( 'image', $entry[ 'post_id' ] );
73 73
 
74 74
         $post_images = array();
75 75
 
76 76
         foreach ( $media as $media_item ) {
77
-            foreach( (array) $post_data['images'] as $post_data_item ) {
78
-                if(
77
+            foreach ( (array)$post_data[ 'images' ] as $post_data_item ) {
78
+                if (
79 79
                     \GV\Utils::get( $post_data_item, 'title' ) === $media_item->post_title &&
80 80
                     \GV\Utils::get( $post_data_item, 'description' ) === $media_item->post_content &&
81 81
                     \GV\Utils::get( $post_data_item, 'caption' ) === $media_item->post_excerpt
82 82
                 ) {
83
-                    $post_images["{$post_data_item['field_id']}"] = $media_item->ID;
83
+                    $post_images[ "{$post_data_item[ 'field_id' ]}" ] = $media_item->ID;
84 84
                 }
85 85
             }
86 86
         }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
          * If the method changes to public, use Gravity Forms' method
109 109
          * @todo: If/when the method is public, remove the unneeded copied code.
110 110
          */
111
-        if( $reflection->isPublic() ) {
111
+        if ( $reflection->isPublic() ) {
112 112
             return parent::get_post_fields( $form, $entry );
113 113
         }
114 114
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
          * If the method changes to public, use Gravity Forms' method
136 136
          * @todo: If/when the method is public, remove the unneeded copied code.
137 137
          */
138
-        if( $reflection->isPublic() ) {
138
+        if ( $reflection->isPublic() ) {
139 139
             return parent::copy_post_image( $url, $post_id );
140 140
         }
141 141
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
          * If the method changes to public, use Gravity Forms' method
171 171
          * @todo: If/when the method is public, remove the unneeded copied code.
172 172
          */
173
-        if( $reflection->isPublic() ) {
173
+        if ( $reflection->isPublic() ) {
174 174
             return parent::media_handle_upload( $url, $post_id, $post_data );
175 175
         }
176 176
 
Please login to merge, or discard this patch.
includes/class-admin-approve-entries.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		/** gf_entries page - entries table screen */
45 45
 
46 46
 		// capture bulk actions
47
-		add_action( 'gform_loaded', array( $this, 'process_bulk_action') );
47
+		add_action( 'gform_loaded', array( $this, 'process_bulk_action' ) );
48 48
 
49 49
 		// add hidden field with approve status
50 50
 		add_action( 'gform_entries_first_column_actions', array( $this, 'add_entry_approved_hidden_input' ), 1, 5 );
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips' ) );
53 53
 
54 54
 		// adding styles and scripts
55
-		add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles') );
55
+		add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ) );
56 56
 		// bypass Gravity Forms no-conflict mode
57 57
 		add_filter( 'gform_noconflict_scripts', array( $this, 'register_gform_noconflict_script' ) );
58 58
 		add_filter( 'gform_noconflict_styles', array( $this, 'register_gform_noconflict_style' ) );
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		 * @param bool $show_filter_links True: show the "approved"/"disapproved" filter links. False: hide them.
82 82
 		 * @param array $form GF Form object of current form
83 83
 		 */
84
-		if( false === apply_filters( 'gravityview/approve_entries/show_filter_links_entry_list', true, $form ) ) {
84
+		if ( false === apply_filters( 'gravityview/approve_entries/show_filter_links_entry_list', true, $form ) ) {
85 85
 			return $filter_links;
86 86
 		}
87 87
 
@@ -109,27 +109,27 @@  discard block
 block discarded – undo
109 109
 		$approved_count = $disapproved_count = $unapproved_count = 0;
110 110
 
111 111
 		// Only count if necessary
112
-		if( $include_counts ) {
113
-			$approved_count = count( gravityview_get_entry_ids( $form['id'], array( 'status' => 'active', 'field_filters' => $field_filters_approved ) ) );
114
-			$disapproved_count = count( gravityview_get_entry_ids( $form['id'], array( 'status' => 'active', 'field_filters' => $field_filters_disapproved ) ) );
115
-			$unapproved_count = count( gravityview_get_entry_ids( $form['id'], array( 'status' => 'active', 'field_filters' => $field_filters_unapproved ) ) );
112
+		if ( $include_counts ) {
113
+			$approved_count = count( gravityview_get_entry_ids( $form[ 'id' ], array( 'status' => 'active', 'field_filters' => $field_filters_approved ) ) );
114
+			$disapproved_count = count( gravityview_get_entry_ids( $form[ 'id' ], array( 'status' => 'active', 'field_filters' => $field_filters_disapproved ) ) );
115
+			$unapproved_count = count( gravityview_get_entry_ids( $form[ 'id' ], array( 'status' => 'active', 'field_filters' => $field_filters_unapproved ) ) );
116 116
 		}
117 117
 
118
-		$filter_links[] = array(
118
+		$filter_links[ ] = array(
119 119
 			'id'            => 'gv_approved',
120 120
 			'field_filters' => $field_filters_approved,
121 121
 			'count'         => $approved_count,
122 122
 			'label'         => GravityView_Entry_Approval_Status::get_label( GravityView_Entry_Approval_Status::APPROVED ),
123 123
 		);
124 124
 
125
-		$filter_links[] = array(
125
+		$filter_links[ ] = array(
126 126
 			'id'            => 'gv_disapproved',
127 127
 			'field_filters' => $field_filters_disapproved,
128 128
 			'count'         => $disapproved_count,
129 129
 			'label'         => GravityView_Entry_Approval_Status::get_label( GravityView_Entry_Approval_Status::DISAPPROVED ),
130 130
 		);
131 131
 
132
-		$filter_links[] = array(
132
+		$filter_links[ ] = array(
133 133
 			'id'            => 'gv_unapproved',
134 134
 			'field_filters' => $field_filters_unapproved,
135 135
 			'count'         => $unapproved_count,
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	function tooltips( $tooltips ) {
150 150
 
151
-		$tooltips['form_gravityview_fields'] = array(
152
-			'title' => __('GravityView Fields', 'gravityview'),
153
-			'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview'),
151
+		$tooltips[ 'form_gravityview_fields' ] = array(
152
+			'title' => __( 'GravityView Fields', 'gravityview' ),
153
+			'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview' ),
154 154
 		);
155 155
 
156 156
 		return $tooltips;
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
 		$gv_bulk_action = false;
263 263
 
264
-		if( version_compare( GFForms::$version, '2.0', '>=' ) ) {
264
+		if ( version_compare( GFForms::$version, '2.0', '>=' ) ) {
265 265
 			$bulk_action = ( '-1' !== \GV\Utils::_POST( 'action' ) ) ? \GV\Utils::_POST( 'action' ) : \GV\Utils::_POST( 'action2' );
266 266
 		} else {
267 267
 			// GF 1.9.x - Bulk action 2 is the bottom bulk action select form.
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 		}
270 270
 
271 271
 		// Check the $bulk_action value against GV actions, see if they're the same. I hate strpos().
272
-		if( ! empty( $bulk_action ) && preg_match( '/^('. implode( '|', $this->bulk_action_prefixes ) .')/ism', $bulk_action ) ) {
272
+		if ( ! empty( $bulk_action ) && preg_match( '/^(' . implode( '|', $this->bulk_action_prefixes ) . ')/ism', $bulk_action ) ) {
273 273
 			$gv_bulk_action = $bulk_action;
274 274
 		}
275 275
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		
295 295
 		// gforms_entry_list is the nonce that confirms we're on the right page
296 296
 		// gforms_update_note is sent when bulk editing entry notes. We don't want to process then.
297
-		if ( $bulk_action && \GV\Utils::_POST( 'gforms_entry_list' ) && empty( $_POST['gforms_update_note'] ) ) {
297
+		if ( $bulk_action && \GV\Utils::_POST( 'gforms_entry_list' ) && empty( $_POST[ 'gforms_update_note' ] ) ) {
298 298
 
299 299
 			check_admin_referer( 'gforms_entry_list', 'gforms_entry_list' );
300 300
 
@@ -312,13 +312,13 @@  discard block
 block discarded – undo
312 312
 			}
313 313
 
314 314
 			// All entries are set to be updated, not just the visible ones
315
-			if ( ! empty( $_POST['all_entries'] ) ) {
315
+			if ( ! empty( $_POST[ 'all_entries' ] ) ) {
316 316
 
317 317
 				// Convert the current entry search into GF-formatted search criteria
318 318
 				$search = array(
319
-					'search_field' => isset( $_POST['f'] ) ? $_POST['f'][0] : 0,
320
-					'search_value' => isset( $_POST['v'][0] ) ? $_POST['v'][0] : '',
321
-					'search_operator' => isset( $_POST['o'][0] ) ? $_POST['o'][0] : 'contains',
319
+					'search_field' => isset( $_POST[ 'f' ] ) ? $_POST[ 'f' ][ 0 ] : 0,
320
+					'search_value' => isset( $_POST[ 'v' ][ 0 ] ) ? $_POST[ 'v' ][ 0 ] : '',
321
+					'search_operator' => isset( $_POST[ 'o' ][ 0 ] ) ? $_POST[ 'o' ][ 0 ] : 'contains',
322 322
 				);
323 323
 
324 324
 				$search_criteria = GravityView_frontend::get_search_criteria( $search, $form_id );
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 			} else {
330 330
 
331 331
 				// Changed from 'lead' to 'entry' in 2.0
332
-				$entries = isset( $_POST['lead'] ) ? $_POST['lead'] : $_POST['entry'];
332
+				$entries = isset( $_POST[ 'lead' ] ) ? $_POST[ 'lead' ] : $_POST[ 'entry' ];
333 333
 
334 334
 			}
335 335
 
@@ -341,15 +341,15 @@  discard block
 block discarded – undo
341 341
 			$entry_count = count( $entries ) > 1 ? sprintf( __( '%d entries', 'gravityview' ), count( $entries ) ) : __( '1 entry', 'gravityview' );
342 342
 
343 343
 			switch ( $approved_status ) {
344
-				case $this->bulk_action_prefixes['approve']:
344
+				case $this->bulk_action_prefixes[ 'approve' ]:
345 345
 					GravityView_Entry_Approval::update_bulk( $entries, GravityView_Entry_Approval_Status::APPROVED, $form_id );
346 346
 					$this->bulk_update_message = sprintf( __( '%s approved.', 'gravityview' ), $entry_count );
347 347
 					break;
348
-				case $this->bulk_action_prefixes['unapprove']:
348
+				case $this->bulk_action_prefixes[ 'unapprove' ]:
349 349
 					GravityView_Entry_Approval::update_bulk( $entries, GravityView_Entry_Approval_Status::UNAPPROVED, $form_id );
350 350
 					$this->bulk_update_message = sprintf( __( '%s unapproved.', 'gravityview' ), $entry_count );
351 351
 					break;
352
-				case $this->bulk_action_prefixes['disapprove']:
352
+				case $this->bulk_action_prefixes[ 'disapprove' ]:
353 353
 					GravityView_Entry_Approval::update_bulk( $entries, GravityView_Entry_Approval_Status::DISAPPROVED, $form_id );
354 354
 					$this->bulk_update_message = sprintf( __( '%s disapproved.', 'gravityview' ), $entry_count );
355 355
 					break;
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
      *
372 372
 	 * @return boolean True: It worked; False: it failed
373 373
 	 */
374
-	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0) {
374
+	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0 ) {
375 375
 		return GravityView_Entry_Approval::update_approved( $entry_id, $approved, $form_id, $approvedcolumn );
376 376
 	}
377 377
 
@@ -401,20 +401,20 @@  discard block
 block discarded – undo
401 401
 	 *
402 402
 	 * @return void
403 403
 	 */
404
-	static public function add_entry_approved_hidden_input(  $form_id, $field_id, $value, $entry, $query_string ) {
404
+	static public function add_entry_approved_hidden_input( $form_id, $field_id, $value, $entry, $query_string ) {
405 405
 
406
-		if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry['id'] ) ) {
406
+		if ( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry[ 'id' ] ) ) {
407 407
 			return;
408 408
 		}
409 409
 
410
-		if( empty( $entry['id'] ) ) {
410
+		if ( empty( $entry[ 'id' ] ) ) {
411 411
 			return;
412 412
 		}
413 413
 
414 414
 		$status_value = GravityView_Entry_Approval::get_entry_status( $entry, 'value' );
415 415
 
416
-		if( $status_value ) {
417
-			echo '<input type="hidden" class="entry_approval" id="entry_approved_'. $entry['id'] .'" value="' . esc_attr( $status_value ) . '" />';
416
+		if ( $status_value ) {
417
+			echo '<input type="hidden" class="entry_approval" id="entry_approved_' . $entry[ 'id' ] . '" value="' . esc_attr( $status_value ) . '" />';
418 418
 		}
419 419
 	}
420 420
 
@@ -427,10 +427,10 @@  discard block
 block discarded – undo
427 427
 	 */
428 428
 	private function get_form_id() {
429 429
 
430
-		$form_id = GFForms::get('id');
430
+		$form_id = GFForms::get( 'id' );
431 431
 
432 432
 		// If there are no forms identified, use the first form. That's how GF does it.
433
-		if( empty( $form_id ) && class_exists('RGFormsModel') ) {
433
+		if ( empty( $form_id ) && class_exists( 'RGFormsModel' ) ) {
434 434
 			$form_id = $this->get_first_form_id();
435 435
 		}
436 436
 
@@ -450,14 +450,14 @@  discard block
 block discarded – undo
450 450
 
451 451
 		$forms = RGFormsModel::get_forms( null, 'title' );
452 452
 
453
-		if( ! isset( $forms[0] ) ) {
453
+		if ( ! isset( $forms[ 0 ] ) ) {
454 454
 			gravityview()->log->error( 'No forms were found' );
455 455
 			return 0;
456 456
 		}
457 457
 
458
-		$first_form = $forms[0];
458
+		$first_form = $forms[ 0 ];
459 459
 
460
-		$form_id = is_object( $forms[0] ) ? $first_form->id : $first_form['id'];
460
+		$form_id = is_object( $forms[ 0 ] ) ? $first_form->id : $first_form[ 'id' ];
461 461
 
462 462
 		return intval( $form_id );
463 463
 	}
@@ -465,33 +465,33 @@  discard block
 block discarded – undo
465 465
 
466 466
 	function add_scripts_and_styles( $hook ) {
467 467
 
468
-		if( ! class_exists( 'GFForms' ) ) {
468
+		if ( ! class_exists( 'GFForms' ) ) {
469 469
 			gravityview()->log->error( 'GFForms does not exist.' );
470 470
 			return;
471 471
 		}
472 472
 
473 473
 		// enqueue styles & scripts gf_entries
474 474
 		// But only if we're on the main Entries page, not on reports pages
475
-		if( GFForms::get_page() !== 'entry_list' ) {
475
+		if ( GFForms::get_page() !== 'entry_list' ) {
476 476
 			return;
477 477
 		}
478 478
 
479 479
 		$form_id = $this->get_form_id();
480 480
 
481 481
 		// Things are broken; no forms were found
482
-		if( empty( $form_id ) ) {
482
+		if ( empty( $form_id ) ) {
483 483
 			return;
484 484
 		}
485 485
 
486
-		wp_enqueue_style( 'gravityview_entries_list', plugins_url('assets/css/admin-entries-list.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version );
486
+		wp_enqueue_style( 'gravityview_entries_list', plugins_url( 'assets/css/admin-entries-list.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
487 487
 
488
-		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
488
+		$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
489 489
 
490
-		wp_enqueue_script( 'gravityview_gf_entries_scripts', plugins_url('assets/js/admin-entries-list'.$script_debug.'.js', GRAVITYVIEW_FILE), array( 'jquery' ), GravityView_Plugin::version );
490
+		wp_enqueue_script( 'gravityview_gf_entries_scripts', plugins_url( 'assets/js/admin-entries-list' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version );
491 491
 
492 492
 		wp_localize_script( 'gravityview_gf_entries_scripts', 'gvGlobals', array(
493
-			'nonce' => wp_create_nonce( 'gravityview_entry_approval'),
494
-			'admin_nonce' => wp_create_nonce( 'gravityview_admin_entry_approval'),
493
+			'nonce' => wp_create_nonce( 'gravityview_entry_approval' ),
494
+			'admin_nonce' => wp_create_nonce( 'gravityview_admin_entry_approval' ),
495 495
 			'form_id' => $form_id,
496 496
 			'show_column' => (int)$this->show_approve_entry_column( $form_id ),
497 497
 			'add_bulk_action' => (int)GVCommon::has_cap( 'gravityview_moderate_entries' ),
@@ -500,10 +500,10 @@  discard block
 block discarded – undo
500 500
 			'status_unapproved' => GravityView_Entry_Approval_Status::UNAPPROVED,
501 501
 			'bulk_actions' => $this->get_bulk_actions( $form_id ),
502 502
 			'bulk_message' => $this->bulk_update_message,
503
-			'unapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('unapproved'),
504
-            'approve_title' => GravityView_Entry_Approval_Status::get_title_attr('disapproved'),
505
-			'disapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('approved'),
506
-			'column_title' => __( 'Show entry in directory view?', 'gravityview'),
503
+			'unapprove_title' => GravityView_Entry_Approval_Status::get_title_attr( 'unapproved' ),
504
+            'approve_title' => GravityView_Entry_Approval_Status::get_title_attr( 'disapproved' ),
505
+			'disapprove_title' => GravityView_Entry_Approval_Status::get_title_attr( 'approved' ),
506
+			'column_title' => __( 'Show entry in directory view?', 'gravityview' ),
507 507
 			'column_link' => esc_url( $this->get_sort_link() ),
508 508
 		) );
509 509
 
@@ -545,16 +545,16 @@  discard block
 block discarded – undo
545 545
 		$bulk_actions = array(
546 546
 			'GravityView' => array(
547 547
 				array(
548
-					'label' => GravityView_Entry_Approval_Status::get_string('approved', 'action'),
549
-					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes['approve'], $form_id ),
548
+					'label' => GravityView_Entry_Approval_Status::get_string( 'approved', 'action' ),
549
+					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes[ 'approve' ], $form_id ),
550 550
 				),
551 551
 				array(
552
-					'label' => GravityView_Entry_Approval_Status::get_string('disapproved', 'action'),
553
-					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes['disapprove'], $form_id ),
552
+					'label' => GravityView_Entry_Approval_Status::get_string( 'disapproved', 'action' ),
553
+					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes[ 'disapprove' ], $form_id ),
554 554
 				),
555 555
 				array(
556
-					'label' => GravityView_Entry_Approval_Status::get_string('unapproved', 'action'),
557
-					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes['unapprove'], $form_id ),
556
+					'label' => GravityView_Entry_Approval_Status::get_string( 'unapproved', 'action' ),
557
+					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes[ 'unapprove' ], $form_id ),
558 558
 				),
559 559
 			),
560 560
 		);
@@ -571,13 +571,13 @@  discard block
 block discarded – undo
571 571
 		// Sanitize the values, just to be sure.
572 572
 		foreach ( $bulk_actions as $key => $group ) {
573 573
 
574
-		    if( empty( $group ) ) {
574
+		    if ( empty( $group ) ) {
575 575
 		        continue;
576 576
 		    }
577 577
 
578 578
 			foreach ( $group as $i => $action ) {
579
-				$bulk_actions[ $key ][ $i ]['label'] = esc_html( $bulk_actions[ $key ][ $i ]['label'] );
580
-				$bulk_actions[ $key ][ $i ]['value'] = esc_attr( $bulk_actions[ $key ][ $i ]['value'] );
579
+				$bulk_actions[ $key ][ $i ][ 'label' ] = esc_html( $bulk_actions[ $key ][ $i ][ 'label' ] );
580
+				$bulk_actions[ $key ][ $i ][ 'value' ] = esc_attr( $bulk_actions[ $key ][ $i ][ 'value' ] );
581 581
 			}
582 582
 		}
583 583
 
@@ -602,13 +602,13 @@  discard block
 block discarded – undo
602 602
 		 * @since 1.7.2
603 603
 		 * @param boolean $hide_if_no_connections
604 604
 		 */
605
-		$hide_if_no_connections = apply_filters('gravityview/approve_entries/hide-if-no-connections', false );
605
+		$hide_if_no_connections = apply_filters( 'gravityview/approve_entries/hide-if-no-connections', false );
606 606
 
607
-		if( $hide_if_no_connections ) {
607
+		if ( $hide_if_no_connections ) {
608 608
 
609 609
 			$connected_views = gravityview_get_connected_views( $form_id );
610 610
 
611
-			if( empty( $connected_views ) ) {
611
+			if ( empty( $connected_views ) ) {
612 612
 				$show_approve_column = false;
613 613
 			}
614 614
 		}
@@ -618,18 +618,18 @@  discard block
 block discarded – undo
618 618
 		 * @param boolean $show_approve_column Whether the column will be shown
619 619
 		 * @param int $form_id The ID of the Gravity Forms form for which entries are being shown
620 620
 		 */
621
-		$show_approve_column = apply_filters('gravityview/approve_entries/show-column', $show_approve_column, $form_id );
621
+		$show_approve_column = apply_filters( 'gravityview/approve_entries/show-column', $show_approve_column, $form_id );
622 622
 
623 623
 		return $show_approve_column;
624 624
 	}
625 625
 
626 626
 	function register_gform_noconflict_script( $scripts ) {
627
-		$scripts[] = 'gravityview_gf_entries_scripts';
627
+		$scripts[ ] = 'gravityview_gf_entries_scripts';
628 628
 		return $scripts;
629 629
 	}
630 630
 
631 631
 	function register_gform_noconflict_style( $styles ) {
632
-		$styles[] = 'gravityview_entries_list';
632
+		$styles[ ] = 'gravityview_entries_list';
633 633
 		return $styles;
634 634
 	}
635 635
 
Please login to merge, or discard this patch.
future/includes/class-gv-extension.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
 		$tab = wp_parse_args( $tab_settings, $tab_defaults );
181 181
 
182 182
 		// Force the screen to be GravityView
183
-		$tab['screen'] = 'gravityview';
183
+		$tab[ 'screen' ] = 'gravityview';
184 184
 
185 185
 		if ( class_exists( 'GravityView_Metabox_Tab' ) ) {
186
-			$metabox = new \GravityView_Metabox_Tab( $tab['id'], $tab['title'], $tab['file'], $tab['icon-class'], $tab['callback'], $tab['callback_args'] );
186
+			$metabox = new \GravityView_Metabox_Tab( $tab[ 'id' ], $tab[ 'title' ], $tab[ 'file' ], $tab[ 'icon-class' ], $tab[ 'callback' ], $tab[ 'callback_args' ] );
187 187
 			\GravityView_Metabox_Tabs::add( $metabox );
188 188
 		} else {
189
-			add_meta_box( 'gravityview_' . $tab['id'], $tab['title'], $tab['callback'], $tab['screen'], $tab['context'], $tab['priority'] );
189
+			add_meta_box( 'gravityview_' . $tab[ 'id' ], $tab[ 'title' ], $tab[ 'callback' ], $tab[ 'screen' ], $tab[ 'context' ], $tab[ 'priority' ] );
190 190
 		}
191 191
 	}
192 192
 
@@ -211,14 +211,14 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	protected function is_extension_supported() {
213 213
 
214
-		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool) self::$is_compatible );
214
+		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool)self::$is_compatible );
215 215
 
216 216
 		if ( ! function_exists( 'gravityview' ) ) {
217 217
 			$message = sprintf( __( 'Could not activate the %s Extension; GravityView is not active.', 'gravityview' ), esc_html( $this->_title ) );
218
-		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version , ">=" ) ) {
219
-			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_gravityview_version.'</tt>' );
220
-		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version , ">=" ) ) {
221
-			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_php_version.'</tt>' );
218
+		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version, ">=" ) ) {
219
+			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_gravityview_version . '</tt>' );
220
+		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version, ">=" ) ) {
221
+			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_php_version . '</tt>' );
222 222
 		} else if ( ! empty( $this->_max_gravityview_version ) && false === version_compare( $this->_max_gravityview_version, Plugin::$version, ">" ) ) {
223 223
 			$message = sprintf( __( 'The %s Extension is not compatible with this version of GravityView. Please update the Extension to the latest version.', 'gravityview' ), esc_html( $this->_title ) );
224 224
 		} else {
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
 
259 259
 		$locale = get_locale();
260 260
 
261
-		if ( function_exists('get_user_locale') && is_admin() ) {
261
+		if ( function_exists( 'get_user_locale' ) && is_admin() ) {
262 262
 			$locale = get_user_locale();
263 263
 		}
264 264
 
265 265
 		// Traditional WordPress plugin locale filter
266
-		$locale = apply_filters( 'plugin_locale',  $locale, $this->_text_domain );
266
+		$locale = apply_filters( 'plugin_locale', $locale, $this->_text_domain );
267 267
 
268 268
 		$mofile = sprintf( '%1$s-%2$s.mo', $this->_text_domain, $locale );
269 269
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	public function settings() {
292 292
 
293 293
 		// If doing ajax, get outta here
294
-		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) )  {
294
+		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST( 'action' ) ) ) {
295 295
 			return;
296 296
 		}
297 297
 
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 			$this->_path,
307 307
 			array(
308 308
             	'version'	=> $this->_version, // current version number
309
-            	'license'	=> \GV\Utils::get( $license, 'license_key', $license['license'] ),
309
+            	'license'	=> \GV\Utils::get( $license, 'license_key', $license[ 'license' ] ),
310 310
 	            'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
311
-            	'item_name' => $this->_title,  // name of this plugin
311
+            	'item_name' => $this->_title, // name of this plugin
312 312
             	'author' 	=> strip_tags( $this->_author )  // author of this plugin
313 313
           	)
314 314
         );
@@ -337,16 +337,16 @@  discard block
 block discarded – undo
337 337
 	 */
338 338
 	public static function add_notice( $notice = array() ) {
339 339
 
340
-		if ( is_array( $notice ) && empty( $notice['message'] ) ) {
340
+		if ( is_array( $notice ) && empty( $notice[ 'message' ] ) ) {
341 341
 			gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) );
342 342
 			return;
343 343
 		} else if ( is_string( $notice ) ) {
344 344
 			$notice = array( 'message' => $notice );
345 345
 		}
346 346
 
347
-		$notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class'];
347
+		$notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ];
348 348
 
349
-		self::$admin_notices []= $notice;
349
+		self::$admin_notices [ ] = $notice;
350 350
 	}
351 351
 
352 352
 	/**
@@ -360,8 +360,8 @@  discard block
 block discarded – undo
360 360
 		}
361 361
 
362 362
 		foreach ( self::$admin_notices as $key => $notice ) {
363
-			echo '<div id="message" class="'. esc_attr( $notice['class'] ).'">';
364
-			echo wpautop( $notice['message'] );
363
+			echo '<div id="message" class="' . esc_attr( $notice[ 'class' ] ) . '">';
364
+			echo wpautop( $notice[ 'message' ] );
365 365
 			echo '<div class="clear"></div>';
366 366
 			echo '</div>';
367 367
 		}
Please login to merge, or discard this patch.
includes/class-admin.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
 
5 5
 	function __construct() {
6 6
 
7
-		if( ! is_admin() ) { return; }
7
+		if ( ! is_admin() ) { return; }
8 8
 
9 9
 		// If Gravity Forms isn't active or compatibile, stop loading
10
-		if( false === GravityView_Compatibility::is_valid() ) {
10
+		if ( false === GravityView_Compatibility::is_valid() ) {
11 11
 			return;
12 12
 		}
13 13
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
49 49
 		add_filter( 'bulk_post_updated_messages', array( $this, 'post_updated_messages' ) );
50 50
 
51
-		add_filter( 'plugin_action_links_'. plugin_basename( GRAVITYVIEW_FILE ) , array( $this, 'plugin_action_links' ) );
51
+		add_filter( 'plugin_action_links_' . plugin_basename( GRAVITYVIEW_FILE ), array( $this, 'plugin_action_links' ) );
52 52
 
53 53
 		add_action( 'plugins_loaded', array( $this, 'backend_actions' ), 100 );
54 54
 
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public static function no_views_text() {
66 66
 
67
-		if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) {
67
+		if ( isset( $_REQUEST[ 'post_status' ] ) && 'trash' === $_REQUEST[ 'post_status' ] ) {
68 68
 			return __( 'No Views found in Trash', 'gravityview' );
69
-		} elseif( ! empty( $_GET['s'] ) ) {
69
+		} elseif ( ! empty( $_GET[ 's' ] ) ) {
70 70
 			return __( 'No Views found.', 'gravityview' );
71 71
 		}
72 72
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			$error .= ' ' . esc_html__( 'or select another form.', 'gravityview' );
111 111
 		}
112 112
 
113
-		if( $error ) {
113
+		if ( $error ) {
114 114
 			?>
115 115
 			<div class="wp-dialog notice-warning inline error wp-clearfix">
116 116
 				<?php echo gravityview_get_floaty(); ?>
@@ -129,23 +129,23 @@  discard block
 block discarded – undo
129 129
 	public function backend_actions() {
130 130
 
131 131
 		/** @define "GRAVITYVIEW_DIR" "../" */
132
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.field.type.php' );
133
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.render.settings.php' );
134
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-item.php' );
135
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-field.php' );
136
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-widget.php' );
137
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-views.php' );
138
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-welcome.php' );
139
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-installer.php' );
140
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-add-shortcode.php' );
141
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' );
132
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.field.type.php' );
133
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.render.settings.php' );
134
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-item.php' );
135
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-field.php' );
136
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-widget.php' );
137
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-views.php' );
138
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-welcome.php' );
139
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-installer.php' );
140
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-add-shortcode.php' );
141
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' );
142 142
 
143 143
 		/**
144 144
 		 * @action `gravityview_include_backend_actions` Triggered after all GravityView admin files are loaded
145 145
 		 *
146 146
 		 * Nice place to insert extensions' backend stuff
147 147
 		 */
148
-		do_action('gravityview_include_backend_actions');
148
+		do_action( 'gravityview_include_backend_actions' );
149 149
 	}
150 150
 
151 151
 	/**
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
 
162 162
 		$actions = array();
163 163
 
164
-		if( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
165
-			$actions[] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
164
+		if ( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
165
+			$actions[ ] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
166 166
 		}
167 167
 
168
-		if( GVCommon::has_cap( 'gravityview_support_port' ) ) {
169
-			$actions[] = '<a href="https://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
168
+		if ( GVCommon::has_cap( 'gravityview_support_port' ) ) {
169
+			$actions[ ] = '<a href="https://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
170 170
 		}
171 171
 
172 172
 		return array_merge( $actions, $links );
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		// By default, there will only be one item being modified.
195 195
 		// When in the `bulk_post_updated_messages` filter, there will be passed a number
196 196
 		// of modified items that will override this array.
197
-		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1 , 'locked' => 1 , 'deleted' => 1 , 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
197
+		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1, 'locked' => 1, 'deleted' => 1, 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
198 198
 
199 199
 		// If we're starting fresh, a new form was created.
200 200
 		// We should let the user know this is the case.
@@ -202,60 +202,60 @@  discard block
 block discarded – undo
202 202
 
203 203
 		$new_form_text = '';
204 204
 
205
-		if( !empty( $start_fresh ) ) {
205
+		if ( ! empty( $start_fresh ) ) {
206 206
 
207 207
 			// Get the form that was created
208 208
 			$connected_form = gravityview_get_form_id( $post_id );
209 209
 
210
-			if( !empty( $connected_form ) ) {
210
+			if ( ! empty( $connected_form ) ) {
211 211
 				$form = gravityview_get_form( $connected_form );
212
-				$form_name = esc_attr( $form['title'] );
212
+				$form_name = esc_attr( $form[ 'title' ] );
213 213
 				$image = self::get_floaty();
214
-				$new_form_text .= '<h3>'.$image.sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ).'</h3>';
215
-				$new_form_text .=  sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
214
+				$new_form_text .= '<h3>' . $image . sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ) . '</h3>';
215
+				$new_form_text .= sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
216 216
 
217 217
 					You can %sedit the form%s in Gravity Forms and the updated fields will be available here. Don&rsquo;t forget to %scustomize the form settings%s.
218
-					', 'gravityview' ), '<strong>', '</strong>', '<a href="'.site_url( '?gf_page=preview&amp;id='.$connected_form ).'">', '</a>', '<code>[gravityform id="'.$connected_form.'" name="'.$form_name.'"]</code>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;id='.$connected_form ).'">', '</a>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id='.$connected_form ).'">', '</a>');
218
+					', 'gravityview' ), '<strong>', '</strong>', '<a href="' . site_url( '?gf_page=preview&amp;id=' . $connected_form ) . '">', '</a>', '<code>[gravityform id="' . $connected_form . '" name="' . $form_name . '"]</code>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;id=' . $connected_form ) . '">', '</a>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=' . $connected_form ) . '">', '</a>' );
219 219
 				$new_form_text = wpautop( $new_form_text );
220 220
 
221 221
 				delete_post_meta( $post_id, '_gravityview_start_fresh' );
222 222
 			}
223 223
 		}
224 224
 
225
-		$messages['gravityview'] = array(
225
+		$messages[ 'gravityview' ] = array(
226 226
 			0  => '', // Unused. Messages start at index 1.
227 227
 			/* translators: %s and %s are HTML tags linking to the View on the website */
228
-			1  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
228
+			1  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
229 229
 			/* translators: %s and %s are HTML tags linking to the View on the website */
230
-			2  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
230
+			2  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
231 231
 			3  => __( 'View deleted.', 'gravityview' ),
232 232
 			/* translators: %s and %s are HTML tags linking to the View on the website */
233
-			4  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
233
+			4  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
234 234
 			/* translators: %s: date and time of the revision */
235
-			5  => isset( $_GET['revision'] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
235
+			5  => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ) ) : false,
236 236
 			/* translators: %s and %s are HTML tags linking to the View on the website */
237
-			6  => sprintf(__( 'View published. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
237
+			6  => sprintf( __( 'View published. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
238 238
 			/* translators: %s and %s are HTML tags linking to the View on the website */
239
-			7  => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
239
+			7  => sprintf( __( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
240 240
 			8  => __( 'View submitted.', 'gravityview' ),
241 241
 			9  => sprintf(
242 242
 		        /* translators: Date and time the View is scheduled to be published */
243 243
 				__( 'View scheduled for: %1$s.', 'gravityview' ),
244 244
 				// translators: Publish box date format, see http://php.net/date
245
-				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL )  ) )
245
+				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) )
246 246
 			) . $new_form_text,
247 247
 			/* translators: %s and %s are HTML tags linking to the View on the website */
248
-			10  => sprintf(__( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
248
+			10  => sprintf( __( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
249 249
 
250 250
 			/**
251 251
 			 * These apply to `bulk_post_updated_messages`
252 252
 			 * @file wp-admin/edit.php
253 253
 			 */
254
-			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts['updated'], 'gravityview' ),
255
-			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts['locked'], 'gravityview' ),
256
-			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts['deleted'], 'gravityview' ),
257
-			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts['trashed'], 'gravityview' ),
258
-			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts['untrashed'], 'gravityview' ),
254
+			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts[ 'updated' ], 'gravityview' ),
255
+			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts[ 'locked' ], 'gravityview' ),
256
+			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts[ 'deleted' ], 'gravityview' ),
257
+			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts[ 'trashed' ], 'gravityview' ),
258
+			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts[ 'untrashed' ], 'gravityview' ),
259 259
 		);
260 260
 
261 261
 		return $messages;
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-search_all.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 
13 13
 $html_input_type = RGFormsModel::is_html5_enabled() ? 'search' : 'text';
14 14
 ?>
15 15
 
16 16
 <div class="gv-search-box gv-search-field-text gv-search-field-search_all">
17 17
 	<div class="gv-search">
18
-	<?php if( ! gv_empty( $label, false, false ) ) { ?>
18
+	<?php if ( ! gv_empty( $label, false, false ) ) { ?>
19 19
 		<label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
20 20
 	<?php } ?>
21 21
 		<p><input type="<?php echo $html_input_type; ?>" name="gv_search" id="gv_search_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-entry_id.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 ?>
13 13
 
14 14
 <div class="gv-search-box gv-search-field-entry_id">
15 15
 	<div class="gv-search">
16
-		<?php if( ! gv_empty( $label, false, false ) ) { ?>
16
+		<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17 17
 		<label for="gv_entry_id_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 		<?php } ?>
19 19
 		<p><input type="text" name="gv_id" id="gv_entry_id_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p>
Please login to merge, or discard this patch.