Completed
Pull Request — master (#747)
by Steve
19:06
created
includes/fields/class-gravityview-field-post-image.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@  discard block
 block discarded – undo
23 23
 
24 24
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
25 25
 
26
-		unset ( $field_options['search_filter'] );
26
+		unset ( $field_options[ 'search_filter' ] );
27 27
 
28
-		if( 'edit' === $context ) {
28
+		if ( 'edit' === $context ) {
29 29
 			return $field_options;
30 30
 		}
31 31
 
32
-		$this->add_field_support('link_to_post', $field_options );
32
+		$this->add_field_support( 'link_to_post', $field_options );
33 33
 
34 34
 		// @since 1.5.4
35
-		$this->add_field_support('dynamic_data', $field_options );
35
+		$this->add_field_support( 'dynamic_data', $field_options );
36 36
 
37 37
 		return $field_options;
38 38
 	}
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		$url = $title = $caption = $description = '';
59 59
 
60 60
 		// If there's a |:| match, process. Otherwise, empty array!
61
-		if( preg_match( '/\|\:\|/', $value ) ) {
61
+		if ( preg_match( '/\|\:\|/', $value ) ) {
62 62
 			list( $url, $title, $caption, $description ) = array_pad( explode( '|:|', $value ), 4, false );
63 63
 		}
64 64
 
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function get_field_input( $form, $value = '', $entry = null, GF_Field_Post_Image $field ) {
89 89
 
90
-		$id = (int) $field->id;
91
-		$form_id = $form['id'];
90
+		$id = (int)$field->id;
91
+		$form_id = $form[ 'id' ];
92 92
 		$input_name = "input_{$id}";
93 93
 		$field_id = sprintf( 'input_%d_%d', $form_id, $id );
94 94
 		$img_name = null;
@@ -96,16 +96,16 @@  discard block
 block discarded – undo
96 96
 		// Convert |:| to associative array
97 97
 		$img_array = $this->explode_value( $value );
98 98
 
99
-		if( ! empty( $img_array['url'] ) ) {
99
+		if ( ! empty( $img_array[ 'url' ] ) ) {
100 100
 
101
-			$img_name = basename( $img_array['url'] );
101
+			$img_name = basename( $img_array[ 'url' ] );
102 102
 
103 103
 			/**
104 104
 			 * Set the $uploaded_files value so that the .ginput_preview renders, and the file upload is hidden
105 105
 			 * @see GF_Field_Post_Image::get_field_input See the `<span class='ginput_preview'>` code
106 106
 			 * @see GFFormsModel::get_temp_filename See the `rgget( $input_name, self::$uploaded_files[ $form_id ] );` code
107 107
 			 */
108
-			if( empty( GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] ) ) {
108
+			if ( empty( GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] ) ) {
109 109
 				GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] = $img_name;
110 110
 			}
111 111
 		}
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 		 * @hack
135 135
 		 */
136 136
 		if ( $img_name ) {
137
-			$current_file = sprintf( "<input name='%s' id='%s' type='hidden' value='%s' />", $input_name, $field_id, esc_url_raw( $img_array['url'] ) );
138
-			$gf_post_image_field_output = str_replace('<span class=\'ginput_preview\'>', '<span class=\'ginput_preview\'>'.$current_file, $gf_post_image_field_output );
137
+			$current_file = sprintf( "<input name='%s' id='%s' type='hidden' value='%s' />", $input_name, $field_id, esc_url_raw( $img_array[ 'url' ] ) );
138
+			$gf_post_image_field_output = str_replace( '<span class=\'ginput_preview\'>', '<span class=\'ginput_preview\'>' . $current_file, $gf_post_image_field_output );
139 139
 		}
140 140
 
141 141
 		return $gf_post_image_field_output;
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-date.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 ?>
12 12
 
13 13
 <div class="gv-search-box gv-search-date">
14
-	<?php if( ! gv_empty( $search_field['label'], false ) ) { ?>
15
-	<label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label>
14
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { ?>
15
+	<label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
16 16
 	<?php } ?>
17 17
 	<p>
18
-		<input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" >
18
+		<input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" >
19 19
 	</p>
20 20
 </div>
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-input_text.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 
11 11
 ?>
12 12
 <div class="gv-search-box gv-search-field-text">
13
-	<?php if( ! gv_empty( $search_field['label'], false ) ) { ?>
14
-	<label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label>
13
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { ?>
14
+	<label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
15 15
 	<?php } ?>
16 16
 	<p>
17
-		<input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>">
17
+		<input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>">
18 18
 	</p>
19 19
 </div>
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
includes/class-template.php 2 patches
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	die;
17 17
 }
18 18
 
19
-if( ! class_exists( 'Gamajo_Template_Loader' ) ) {
19
+if ( ! class_exists( 'Gamajo_Template_Loader' ) ) {
20 20
 	require( GRAVITYVIEW_DIR . 'includes/lib/class-gamajo-template-loader.php' );
21 21
 }
22 22
 
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 			'atts'	  => NULL,
158 158
 		) );
159 159
 
160
-		foreach ($atts as $key => $value) {
161
-			if( is_null( $value ) ) {
160
+		foreach ( $atts as $key => $value ) {
161
+			if ( is_null( $value ) ) {
162 162
 				continue;
163 163
 			}
164 164
 			$this->{$key} = $value;
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	static function getInstance( $passed_post = NULL ) {
191 191
 
192
-		if( empty( self::$instance ) ) {
192
+		if ( empty( self::$instance ) ) {
193 193
 			self::$instance = new self( $passed_post );
194 194
 		}
195 195
 
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
 	 */
203 203
 	public function getCurrentField( $key = NULL ) {
204 204
 
205
-		if( !empty( $key ) ) {
206
-			if( isset( $this->_current_field[ $key ] ) ) {
205
+		if ( ! empty( $key ) ) {
206
+			if ( isset( $this->_current_field[ $key ] ) ) {
207 207
 				return $this->_current_field[ $key ];
208 208
 			}
209 209
 			return NULL;
@@ -214,16 +214,16 @@  discard block
 block discarded – undo
214 214
 
215 215
 	public function setCurrentFieldSetting( $key, $value ) {
216 216
 
217
-		if( !empty( $this->_current_field ) ) {
218
-			$this->_current_field['field_settings'][ $key ] = $value;
217
+		if ( ! empty( $this->_current_field ) ) {
218
+			$this->_current_field[ 'field_settings' ][ $key ] = $value;
219 219
 		}
220 220
 
221 221
 	}
222 222
 
223 223
 	public function getCurrentFieldSetting( $key ) {
224
-		$settings = $this->getCurrentField('field_settings');
224
+		$settings = $this->getCurrentField( 'field_settings' );
225 225
 
226
-		if( $settings && !empty( $settings[ $key ] ) ) {
226
+		if ( $settings && ! empty( $settings[ $key ] ) ) {
227 227
 			return $settings[ $key ];
228 228
 		}
229 229
 
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public function getAtts( $key = NULL ) {
256 256
 
257
-		if( !empty( $key ) ) {
258
-			if( isset( $this->atts[ $key ] ) ) {
257
+		if ( ! empty( $key ) ) {
258
+			if ( isset( $this->atts[ $key ] ) ) {
259 259
 				return $this->atts[ $key ];
260 260
 			}
261 261
 			return NULL;
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
 		$fields = empty( $this->fields ) ? NULL : $this->fields;
323 323
 
324
-		if( $fields && !empty( $key ) ) {
324
+		if ( $fields && ! empty( $key ) ) {
325 325
 			$fields = isset( $fields[ $key ] ) ? $fields[ $key ] : NULL;
326 326
 		}
327 327
 
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 	 */
342 342
 	public function getField( $key ) {
343 343
 
344
-		if( !empty( $key ) ) {
345
-			if( isset( $this->fields[ $key ] ) ) {
344
+		if ( ! empty( $key ) ) {
345
+			if ( isset( $this->fields[ $key ] ) ) {
346 346
 				return $this->fields[ $key ];
347 347
 			}
348 348
 		}
@@ -442,8 +442,8 @@  discard block
 block discarded – undo
442 442
 	public function getPaginationCounts() {
443 443
 
444 444
 		$paging = $this->getPaging();
445
-		$offset = $paging['offset'];
446
-		$page_size = $paging['page_size'];
445
+		$offset = $paging[ 'offset' ];
446
+		$page_size = $paging[ 'page_size' ];
447 447
 		$total = $this->getTotalEntries();
448 448
 
449 449
 		if ( empty( $total ) ) {
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 		 */
465 465
 		list( $first, $last, $total ) = apply_filters( 'gravityview_pagination_counts', array( $first, $last, $total ) );
466 466
 
467
-		return array( 'first' => (int) $first, 'last' => (int) $last, 'total' => (int) $total );
467
+		return array( 'first' => (int)$first, 'last' => (int)$last, 'total' => (int)$total );
468 468
 	}
469 469
 
470 470
 	/**
@@ -548,16 +548,16 @@  discard block
 block discarded – undo
548 548
 	 */
549 549
 	public function getCurrentEntry() {
550 550
 
551
-		if( in_array( $this->getContext(), array( 'edit', 'single') ) ) {
551
+		if ( in_array( $this->getContext(), array( 'edit', 'single' ) ) ) {
552 552
 			$entries = $this->getEntries();
553
-			$entry = $entries[0];
553
+			$entry = $entries[ 0 ];
554 554
 		} else {
555 555
 			$entry = $this->_current_entry;
556 556
 		}
557 557
 
558 558
 		/** @since 1.16 Fixes DataTables empty entry issue */
559
-		if ( empty( $entry ) && ! empty( $this->_current_field['entry'] ) ) {
560
-			$entry = $this->_current_field['entry'];
559
+		if ( empty( $entry ) && ! empty( $this->_current_field[ 'entry' ] ) ) {
560
+			$entry = $this->_current_field[ 'entry' ];
561 561
 		}
562 562
 
563 563
 		return $entry;
@@ -594,8 +594,8 @@  discard block
 block discarded – undo
594 594
 	 */
595 595
 	public function renderZone( $zone = '', $atts = array(), $echo = true ) {
596 596
 
597
-		if( empty( $zone ) ) {
598
-			do_action('gravityview_log_error', 'GravityView_View[renderZone] No zone defined.');
597
+		if ( empty( $zone ) ) {
598
+			do_action( 'gravityview_log_error', 'GravityView_View[renderZone] No zone defined.' );
599 599
 			return NULL;
600 600
 		}
601 601
 
@@ -604,33 +604,33 @@  discard block
 block discarded – undo
604 604
 			'context' => $this->getContext(),
605 605
 			'entry' => $this->getCurrentEntry(),
606 606
 			'form' => $this->getForm(),
607
-			'hide_empty' => $this->getAtts('hide_empty'),
607
+			'hide_empty' => $this->getAtts( 'hide_empty' ),
608 608
 		);
609 609
 
610 610
 		$final_atts = wp_parse_args( $atts, $defaults );
611 611
 
612 612
 		$output = '';
613 613
 
614
-		$final_atts['zone_id'] = "{$final_atts['context']}_{$final_atts['slug']}-{$zone}";
614
+		$final_atts[ 'zone_id' ] = "{$final_atts[ 'context' ]}_{$final_atts[ 'slug' ]}-{$zone}";
615 615
 
616
-		$fields = $this->getField( $final_atts['zone_id'] );
616
+		$fields = $this->getField( $final_atts[ 'zone_id' ] );
617 617
 
618 618
 		// Backward compatibility
619
-		if( 'table' === $this->getTemplatePartSlug() ) {
619
+		if ( 'table' === $this->getTemplatePartSlug() ) {
620 620
 			/**
621 621
 			 * Modify the fields displayed in the table
622 622
 			 * @var array
623 623
 			 */
624
-			$fields = apply_filters("gravityview_table_cells", $fields, $this );
624
+			$fields = apply_filters( "gravityview_table_cells", $fields, $this );
625 625
 		}
626 626
 
627
-		if( empty( $fields ) ) {
627
+		if ( empty( $fields ) ) {
628 628
 			return NULL;
629 629
 		}
630 630
 
631 631
 		$field_output = '';
632 632
 		foreach ( $fields as $field ) {
633
-			$final_atts['field'] = $field;
633
+			$final_atts[ 'field' ] = $field;
634 634
 
635 635
 			$field_output .= gravityview_field_output( $final_atts );
636 636
 		}
@@ -641,21 +641,21 @@  discard block
 block discarded – undo
641 641
 		 * @since 1.7.6
642 642
 		 * @param boolean $hide_empty_zone Default: false
643 643
 		 */
644
-		if( empty( $field_output ) && apply_filters( 'gravityview/render/hide-empty-zone', false ) ) {
644
+		if ( empty( $field_output ) && apply_filters( 'gravityview/render/hide-empty-zone', false ) ) {
645 645
 			return NULL;
646 646
 		}
647 647
 
648
-		if( !empty( $final_atts['wrapper_class'] ) ) {
649
-			$output .= '<div class="'.gravityview_sanitize_html_class( $final_atts['wrapper_class'] ).'">';
648
+		if ( ! empty( $final_atts[ 'wrapper_class' ] ) ) {
649
+			$output .= '<div class="' . gravityview_sanitize_html_class( $final_atts[ 'wrapper_class' ] ) . '">';
650 650
 		}
651 651
 
652 652
 		$output .= $field_output;
653 653
 
654
-		if( !empty( $final_atts['wrapper_class'] ) ) {
654
+		if ( ! empty( $final_atts[ 'wrapper_class' ] ) ) {
655 655
 			$output .= '</div>';
656 656
 		}
657 657
 
658
-		if( $echo ) {
658
+		if ( $echo ) {
659 659
 			echo $output;
660 660
 		}
661 661
 
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
 	 */
674 674
 	function locate_template( $template_names, $load = false, $require_once = true ) {
675 675
 
676
-		if( is_string( $template_names ) && isset( $this->located_templates[ $template_names ] ) ) {
676
+		if ( is_string( $template_names ) && isset( $this->located_templates[ $template_names ] ) ) {
677 677
 
678 678
 			$located = $this->located_templates[ $template_names ];
679 679
 
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 			// Set $load to always false so we handle it here.
683 683
 			$located = parent::locate_template( $template_names, false, $require_once );
684 684
 
685
-			if( is_string( $template_names ) ) {
685
+			if ( is_string( $template_names ) ) {
686 686
 				$this->located_templates[ $template_names ] = $located;
687 687
 			}
688 688
 		}
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 	 * @return mixed|null    The stored data.
701 701
 	 */
702 702
 	public function __get( $name ) {
703
-		if( isset( $this->{$name} ) ) {
703
+		if ( isset( $this->{$name} ) ) {
704 704
 			return $this->{$name};
705 705
 		} else {
706 706
 			return NULL;
@@ -729,15 +729,15 @@  discard block
 block discarded – undo
729 729
 		$additional = array();
730 730
 
731 731
 		// form-19-table-body.php
732
-		$additional[] = sprintf( 'form-%d-%s-%s.php', $this->getFormId(), $slug, $name );
732
+		$additional[ ] = sprintf( 'form-%d-%s-%s.php', $this->getFormId(), $slug, $name );
733 733
 
734 734
 		// view-3-table-body.php
735
-		$additional[] = sprintf( 'view-%d-%s-%s.php', $this->getViewId(), $slug, $name );
735
+		$additional[ ] = sprintf( 'view-%d-%s-%s.php', $this->getViewId(), $slug, $name );
736 736
 
737
-		if( $this->getPostId() ) {
737
+		if ( $this->getPostId() ) {
738 738
 
739 739
 			// page-19-table-body.php
740
-			$additional[] = sprintf( 'page-%d-%s-%s.php', $this->getPostId(), $slug, $name );
740
+			$additional[ ] = sprintf( 'page-%d-%s-%s.php', $this->getPostId(), $slug, $name );
741 741
 		}
742 742
 
743 743
 		// Combine with existing table-body.php and table.php
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 
760 760
 		do_action( 'gravityview_log_debug', '[render] Rendering Template File', $template_file );
761 761
 
762
-		if( !empty( $template_file) ) {
762
+		if ( ! empty( $template_file ) ) {
763 763
 
764 764
 			if ( $require_once ) {
765 765
 				require_once( $template_file );
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 	 */
777 777
 	public function render_widget_hooks( $view_id ) {
778 778
 
779
-		if( empty( $view_id ) || 'single' == gravityview_get_context() ) {
779
+		if ( empty( $view_id ) || 'single' == gravityview_get_context() ) {
780 780
 			do_action( 'gravityview_log_debug', __METHOD__ . ' - Not rendering widgets; single entry' );
781 781
 			return;
782 782
 		}
@@ -784,9 +784,9 @@  discard block
 block discarded – undo
784 784
 		$view_data = gravityview_get_current_view_data( $view_id );
785 785
 
786 786
 		// get View widget configuration
787
-		$widgets = (array)$view_data['widgets'];
787
+		$widgets = (array)$view_data[ 'widgets' ];
788 788
 
789
-		switch( current_filter() ) {
789
+		switch ( current_filter() ) {
790 790
 			default:
791 791
 			case 'gravityview_before':
792 792
 				$zone = 'header';
@@ -800,9 +800,9 @@  discard block
 block discarded – undo
800 800
 		 * Filter widgets not in the current zone
801 801
 		 * @since 1.16
802 802
 		 */
803
-		foreach( $widgets as $key => $widget ) {
803
+		foreach ( $widgets as $key => $widget ) {
804 804
 			// The widget isn't in the current zone
805
-			if( false === strpos( $key, $zone ) ) {
805
+			if ( false === strpos( $key, $zone ) ) {
806 806
 				unset( $widgets[ $key ] );
807 807
 			}
808 808
 		}
@@ -817,8 +817,8 @@  discard block
 block discarded – undo
817 817
 		}
818 818
 
819 819
 		// Prevent being called twice
820
-		if( did_action( $zone.'_'.$view_id.'_widgets' ) ) {
821
-			do_action( 'gravityview_log_debug', sprintf( '%s - Not rendering %s; already rendered', __METHOD__ , $zone.'_'.$view_id.'_widgets' ) );
820
+		if ( did_action( $zone . '_' . $view_id . '_widgets' ) ) {
821
+			do_action( 'gravityview_log_debug', sprintf( '%s - Not rendering %s; already rendered', __METHOD__, $zone . '_' . $view_id . '_widgets' ) );
822 822
 			return;
823 823
 		}
824 824
 
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 
830 830
 		$default_css_class = 'gv-grid gv-widgets-' . $zone;
831 831
 
832
-		if( 0 === GravityView_View::getInstance()->getTotalEntries() ) {
832
+		if ( 0 === GravityView_View::getInstance()->getTotalEntries() ) {
833 833
 			$default_css_class .= ' gv-widgets-no-results';
834 834
 		}
835 835
 
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 		 * @param string $zone Current widget zone, either `header` or `footer`
841 841
 		 * @param array $widgets Array of widget configurations for the current zone, as set by `gravityview_get_current_view_data()['widgets']`
842 842
 		 */
843
-		$css_class = apply_filters('gravityview/widgets/wrapper_css_class', $default_css_class, $zone, $widgets );
843
+		$css_class = apply_filters( 'gravityview/widgets/wrapper_css_class', $default_css_class, $zone, $widgets );
844 844
 
845 845
 		$css_class = gravityview_sanitize_html_class( $css_class );
846 846
 
@@ -848,17 +848,17 @@  discard block
 block discarded – undo
848 848
 		?>
849 849
 		<div class="<?php echo $css_class; ?>">
850 850
 			<?php
851
-			foreach( $rows as $row ) {
852
-				foreach( $row as $col => $areas ) {
853
-					$column = ($col == '2-2') ? '1-2 gv-right' : $col.' gv-left';
851
+			foreach ( $rows as $row ) {
852
+				foreach ( $row as $col => $areas ) {
853
+					$column = ( $col == '2-2' ) ? '1-2 gv-right' : $col . ' gv-left';
854 854
 				?>
855 855
 					<div class="gv-grid-col-<?php echo esc_attr( $column ); ?>">
856 856
 						<?php
857
-						if( !empty( $areas ) ) {
858
-							foreach( $areas as $area ) {
859
-								if( !empty( $widgets[ $zone .'_'. $area['areaid'] ] ) ) {
860
-									foreach( $widgets[ $zone .'_'. $area['areaid'] ] as $widget ) {
861
-										do_action( "gravityview_render_widget_{$widget['id']}", $widget );
857
+						if ( ! empty( $areas ) ) {
858
+							foreach ( $areas as $area ) {
859
+								if ( ! empty( $widgets[ $zone . '_' . $area[ 'areaid' ] ] ) ) {
860
+									foreach ( $widgets[ $zone . '_' . $area[ 'areaid' ] ] as $widget ) {
861
+										do_action( "gravityview_render_widget_{$widget[ 'id' ]}", $widget );
862 862
 									}
863 863
 								}
864 864
 							}
@@ -874,8 +874,8 @@  discard block
 block discarded – undo
874 874
 		 * Prevent widgets from being called twice.
875 875
 		 * Checking for loop_start prevents themes and plugins that pre-process shortcodes from triggering the action before displaying. Like, ahem, the Divi theme and WordPress SEO plugin
876 876
 		 */
877
-		if( did_action( 'loop_start' ) ) {
878
-			do_action( $zone.'_'.$view_id.'_widgets' );
877
+		if ( did_action( 'loop_start' ) ) {
878
+			do_action( $zone . '_' . $view_id . '_widgets' );
879 879
 		}
880 880
 	}
881 881
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -220,6 +220,9 @@
 block discarded – undo
220 220
 
221 221
 	}
222 222
 
223
+	/**
224
+	 * @param string $key
225
+	 */
223 226
 	public function getCurrentFieldSetting( $key ) {
224 227
 		$settings = $this->getCurrentField('field_settings');
225 228
 
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-multiselect.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 $search_field = $gravityview_view->search_field;
11 11
 
12 12
 // Make sure that there are choices to display
13
-if( empty( $search_field['choices'] ) ) {
14
-	do_action('gravityview_log_debug', 'search-field-multiselect.php - No choices for field' );
13
+if ( empty( $search_field[ 'choices' ] ) ) {
14
+	do_action( 'gravityview_log_debug', 'search-field-multiselect.php - No choices for field' );
15 15
 	return;
16 16
 }
17 17
 
@@ -21,19 +21,19 @@  discard block
 block discarded – undo
21 21
  * @param string $default_option Default: `&mdash;` (—)
22 22
  * @param string $field_type Field type: "select" or "multiselect"
23 23
  */
24
-$default_option = apply_filters('gravityview/extension/search/select_default', '&mdash;', 'multiselect' );
24
+$default_option = apply_filters( 'gravityview/extension/search/select_default', '&mdash;', 'multiselect' );
25 25
 
26 26
 ?>
27 27
 <div class="gv-search-box">
28
-	<?php if( ! gv_empty( $search_field['label'], false ) ) { ?>
29
-		<label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label>
28
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { ?>
29
+		<label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
30 30
 	<?php } ?>
31 31
 	<p>
32
-		<select name="<?php echo esc_attr( $search_field['name'] ); ?>[]" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" multiple>
33
-			<option value="" <?php gv_selected( '', $search_field['value'], true ); ?>><?php echo esc_html( $default_option ); ?></option>
32
+		<select name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>[]" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" multiple>
33
+			<option value="" <?php gv_selected( '', $search_field[ 'value' ], true ); ?>><?php echo esc_html( $default_option ); ?></option>
34 34
 			<?php
35
-			foreach( $search_field['choices'] as $choice ) : ?>
36
-				<option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true ); ?>><?php echo esc_html( $choice['text'] ); ?></option>
35
+			foreach ( $search_field[ 'choices' ] as $choice ) : ?>
36
+				<option value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" <?php gv_selected( $choice[ 'value' ], $search_field[ 'value' ], true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option>
37 37
 			<?php endforeach; ?>
38 38
 		</select>
39 39
 	</p>
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-date.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -255,7 +255,6 @@
 block discarded – undo
255 255
 	 * Get the default date format for a field based on the field ID and the time format setting
256 256
 	 *
257 257
 	 * @since 1.14
258
-
259 258
 	 * @param string $time_format The time format ("12" or "24"). Default: "12" {@since 1.14}
260 259
 	 * @param int $field_id The ID of the field. Used to figure out full time/hours/minutes/am/pm {@since 1.14}
261 260
 	 *
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 
24 24
 	function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) {
25 25
 
26
-		if( 'edit' === $context ) {
26
+		if ( 'edit' === $context ) {
27 27
 			return $field_options;
28 28
 		}
29 29
 
30
-		$this->add_field_support('date_display', $field_options );
30
+		$this->add_field_support( 'date_display', $field_options );
31 31
 
32 32
 		return $field_options;
33 33
 	}
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		$field_input_id = gravityview_get_input_id_from_id( $field_id );
52 52
 
53 53
 		$date_field_output = '';
54
-		switch( $field_input_id ) {
54
+		switch ( $field_input_id ) {
55 55
 			case 1:
56 56
 				$date_field_output = rgar( $parsed_date, 'day' );
57 57
 				break;
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-quiz.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
20 20
 
21
-		if( 'edit' === $context ) {
21
+		if ( 'edit' === $context ) {
22 22
 			return $field_options;
23 23
 		}
24 24
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 			'quiz_show_explanation' => array(
27 27
 				'type' => 'checkbox',
28 28
 				'label' => __( 'Show Answer Explanation?', 'gravityview' ),
29
-				'desc' => __('If the field has an answer explanation, show it?', 'gravityview'),
29
+				'desc' => __( 'If the field has an answer explanation, show it?', 'gravityview' ),
30 30
 				'value' => false,
31 31
 				'merge_tags' => false,
32 32
 			),
Please login to merge, or discard this patch.
includes/wordpress-widgets/class-gravityview-search-wp-widget.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 		$widget_ops = array(
13 13
 			'classname' => 'widget_gravityview_search',
14
-			'description' => __( 'A search form for a specific GravityView.', 'gravityview')
14
+			'description' => __( 'A search form for a specific GravityView.', 'gravityview' )
15 15
 		);
16 16
 
17 17
 		$widget_display = array(
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	}
35 35
 
36 36
 	private function load_required_files() {
37
-		if( !class_exists( 'GravityView_Widget_Search' ) ) {
37
+		if ( ! class_exists( 'GravityView_Widget_Search' ) ) {
38 38
 			gravityview_register_gravityview_widgets();
39 39
 		}
40 40
 	}
@@ -53,30 +53,30 @@  discard block
 block discarded – undo
53 53
 	public function widget( $args, $instance ) {
54 54
 
55 55
 		// Don't show unless a View ID has been set.
56
-		if( empty( $instance['view_id'] ) ) {
56
+		if ( empty( $instance[ 'view_id' ] ) ) {
57 57
 
58
-			do_action('gravityview_log_debug', sprintf( '%s[widget]: No View ID has been defined. Not showing the widget.', get_class($this)), $instance );
58
+			do_action( 'gravityview_log_debug', sprintf( '%s[widget]: No View ID has been defined. Not showing the widget.', get_class( $this ) ), $instance );
59 59
 
60 60
 			return;
61 61
 		}
62 62
 
63 63
 		/** This filter is documented in wp-includes/default-widgets.php */
64
-		$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
64
+		$title = apply_filters( 'widget_title', empty( $instance[ 'title' ] ) ? '' : $instance[ 'title' ], $instance, $this->id_base );
65 65
 
66
-		echo $args['before_widget'];
66
+		echo $args[ 'before_widget' ];
67 67
 
68 68
 		if ( $title ) {
69
-			echo $args['before_title'] . $title . $args['after_title'];
69
+			echo $args[ 'before_title' ] . $title . $args[ 'after_title' ];
70 70
 		}
71 71
 
72 72
 		// @todo Add to the widget configuration form
73
-		$instance['search_layout'] = apply_filters( 'gravityview/widget/search/layout', 'vertical', $instance );
73
+		$instance[ 'search_layout' ] = apply_filters( 'gravityview/widget/search/layout', 'vertical', $instance );
74 74
 
75
-		$instance['context'] = 'wp_widget';
75
+		$instance[ 'context' ] = 'wp_widget';
76 76
 
77 77
 		// form
78
-		$instance['form_id'] = GVCommon::get_meta_form_id( $instance['view_id'] );
79
-		$instance['form'] = GVCommon::get_form( $instance['form_id'] );
78
+		$instance[ 'form_id' ] = GVCommon::get_meta_form_id( $instance[ 'view_id' ] );
79
+		$instance[ 'form' ] = GVCommon::get_form( $instance[ 'form_id' ] );
80 80
 
81 81
 		// We don't want to overwrite existing context, etc.
82 82
 		$previous_view = GravityView_View::getInstance();
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		 */
93 93
 		new GravityView_View( $previous_view );
94 94
 
95
-		echo $args['after_widget'];
95
+		echo $args[ 'after_widget' ];
96 96
 	}
97 97
 
98 98
 	/**
@@ -102,27 +102,27 @@  discard block
 block discarded – undo
102 102
 
103 103
 		$instance = $old_instance;
104 104
 
105
-		if( $this->is_preview() ) {
105
+		if ( $this->is_preview() ) {
106 106
 			//Oh! Sorry but still not fully compatible with customizer
107 107
 			return $instance;
108 108
 		}
109 109
 
110
-		$new_instance = wp_parse_args( (array) $new_instance, self::get_defaults() );
110
+		$new_instance = wp_parse_args( (array)$new_instance, self::get_defaults() );
111 111
 
112
-		$instance['title'] = strip_tags( $new_instance['title'] );
113
-		$instance['view_id'] = absint( $new_instance['view_id'] );
114
-		$instance['search_fields'] = $new_instance['search_fields'];
115
-		$instance['post_id'] = $new_instance['post_id'];
116
-		$instance['search_clear'] = $new_instance['search_clear'];
117
-		$instance['search_mode'] = $new_instance['search_mode'];
112
+		$instance[ 'title' ] = strip_tags( $new_instance[ 'title' ] );
113
+		$instance[ 'view_id' ] = absint( $new_instance[ 'view_id' ] );
114
+		$instance[ 'search_fields' ] = $new_instance[ 'search_fields' ];
115
+		$instance[ 'post_id' ] = $new_instance[ 'post_id' ];
116
+		$instance[ 'search_clear' ] = $new_instance[ 'search_clear' ];
117
+		$instance[ 'search_mode' ] = $new_instance[ 'search_mode' ];
118 118
 
119
-		$is_valid_embed_id = GravityView_View_Data::is_valid_embed_id( $new_instance['post_id'], $instance['view_id'] );
119
+		$is_valid_embed_id = GravityView_View_Data::is_valid_embed_id( $new_instance[ 'post_id' ], $instance[ 'view_id' ] );
120 120
 
121 121
 		//check if post_id is a valid post with embedded View
122
-		$instance['error_post_id'] = is_wp_error( $is_valid_embed_id ) ? $is_valid_embed_id->get_error_message() : NULL;
122
+		$instance[ 'error_post_id' ] = is_wp_error( $is_valid_embed_id ) ? $is_valid_embed_id->get_error_message() : NULL;
123 123
 
124 124
 		// Share that the widget isn't brand new
125
-		$instance['updated']  = 1;
125
+		$instance[ 'updated' ] = 1;
126 126
 
127 127
 		return $instance;
128 128
 	}
@@ -133,28 +133,28 @@  discard block
 block discarded – undo
133 133
 	public function form( $instance ) {
134 134
 
135 135
 		// @todo Make compatible with Customizer
136
-		if( $this->is_preview() ) {
136
+		if ( $this->is_preview() ) {
137 137
 
138
-			$warning = sprintf( esc_html__( 'This widget is not configurable from this screen. Please configure it on the %sWidgets page%s.', 'gravityview' ), '<a href="'.admin_url('widgets.php').'">', '</a>' );
138
+			$warning = sprintf( esc_html__( 'This widget is not configurable from this screen. Please configure it on the %sWidgets page%s.', 'gravityview' ), '<a href="' . admin_url( 'widgets.php' ) . '">', '</a>' );
139 139
 
140 140
 			echo wpautop( GravityView_Admin::get_floaty() . $warning );
141 141
 
142 142
 			return;
143 143
 		}
144 144
 
145
-		$instance = wp_parse_args( (array) $instance, self::get_defaults() );
145
+		$instance = wp_parse_args( (array)$instance, self::get_defaults() );
146 146
 
147
-		$title    = $instance['title'];
148
-		$view_id  = $instance['view_id'];
149
-		$post_id  = $instance['post_id'];
150
-		$search_fields = $instance['search_fields'];
151
-		$search_clear = $instance['search_clear'];
152
-		$search_mode = $instance['search_mode'];
147
+		$title    = $instance[ 'title' ];
148
+		$view_id  = $instance[ 'view_id' ];
149
+		$post_id  = $instance[ 'post_id' ];
150
+		$search_fields = $instance[ 'search_fields' ];
151
+		$search_clear = $instance[ 'search_clear' ];
152
+		$search_mode = $instance[ 'search_mode' ];
153 153
 
154 154
 		$views = GVCommon::get_all_views();
155 155
 
156 156
 		// If there are no views set up yet, we get outta here.
157
-		if( empty( $views ) ) { ?>
157
+		if ( empty( $views ) ) { ?>
158 158
 			<div id="select_gravityview_view">
159 159
 				<div class="wrap"><?php echo GravityView_Post_Types::no_views_text(); ?></div>
160 160
 			</div>
@@ -162,17 +162,17 @@  discard block
 block discarded – undo
162 162
 		}
163 163
 		?>
164 164
 
165
-		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'gravityview'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></label></p>
165
+		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'gravityview' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></label></p>
166 166
 
167 167
 		<?php
168 168
 		/**
169 169
 		 * Display errors generated for invalid embed IDs
170 170
 		 * @see GravityView_View_Data::is_valid_embed_id
171 171
 		 */
172
-		if( isset( $instance['updated'] ) && empty( $instance['view_id'] ) ) {
172
+		if ( isset( $instance[ 'updated' ] ) && empty( $instance[ 'view_id' ] ) ) {
173 173
 			?>
174 174
 			<div class="error inline hide-on-view-change">
175
-				<p><?php esc_html_e('Please select a View to search.', 'gravityview'); ?></p>
175
+				<p><?php esc_html_e( 'Please select a View to search.', 'gravityview' ); ?></p>
176 176
 			</div>
177 177
 			<?php
178 178
 			unset ( $error );
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
 
182 182
 		<p>
183 183
 			<label for="gravityview_view_id"><?php _e( 'View:', 'gravityview' ); ?></label>
184
-			<select id="gravityview_view_id" name="<?php echo $this->get_field_name('view_id'); ?>" class="widefat">
184
+			<select id="gravityview_view_id" name="<?php echo $this->get_field_name( 'view_id' ); ?>" class="widefat">
185 185
 				<option value=""><?php esc_html_e( '&mdash; Select a View &mdash;', 'gravityview' ); ?></option>
186 186
 				<?php
187
-				foreach( $views as $view_option ) {
188
-					$title = empty( $view_option->post_title ) ? __('(no title)', 'gravityview') : $view_option->post_title;
189
-					echo '<option value="'. $view_option->ID .'" ' . selected( esc_attr( $view_id ), $view_option->ID, false ) . '>'. esc_html( sprintf('%s #%d', $title, $view_option->ID ) ) .'</option>';
187
+				foreach ( $views as $view_option ) {
188
+					$title = empty( $view_option->post_title ) ? __( '(no title)', 'gravityview' ) : $view_option->post_title;
189
+					echo '<option value="' . $view_option->ID . '" ' . selected( esc_attr( $view_id ), $view_option->ID, false ) . '>' . esc_html( sprintf( '%s #%d', $title, $view_option->ID ) ) . '</option>';
190 190
 				}
191 191
 				?>
192 192
 			</select>
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
 		 * Display errors generated for invalid embed IDs
199 199
 		 * @see GravityView_View_Data::is_valid_embed_id
200 200
 		 */
201
-		if( !empty( $instance['error_post_id'] ) ) {
201
+		if ( ! empty( $instance[ 'error_post_id' ] ) ) {
202 202
 			?>
203 203
 			<div class="error inline">
204
-				<p><?php echo $instance['error_post_id']; ?></p>
204
+				<p><?php echo $instance[ 'error_post_id' ]; ?></p>
205 205
 			</div>
206 206
 			<?php
207 207
 			unset ( $error );
@@ -209,40 +209,40 @@  discard block
 block discarded – undo
209 209
 		?>
210 210
 
211 211
 		<p>
212
-			<label for="<?php echo $this->get_field_id('post_id'); ?>"><?php esc_html_e( 'If Embedded, Page ID:', 'gravityview' ); ?></label>
213
-			<input class="code" size="3" id="<?php echo $this->get_field_id('post_id'); ?>" name="<?php echo $this->get_field_name('post_id'); ?>" type="text" value="<?php echo esc_attr( $post_id ); ?>" />
212
+			<label for="<?php echo $this->get_field_id( 'post_id' ); ?>"><?php esc_html_e( 'If Embedded, Page ID:', 'gravityview' ); ?></label>
213
+			<input class="code" size="3" id="<?php echo $this->get_field_id( 'post_id' ); ?>" name="<?php echo $this->get_field_name( 'post_id' ); ?>" type="text" value="<?php echo esc_attr( $post_id ); ?>" />
214 214
 			<span class="howto"><?php
215
-				esc_html_e('To have a search performed on an embedded View, enter the ID of the post or page where the View is embedded.', 'gravityview' );
216
-				echo ' '.gravityview_get_link('http://docs.gravityview.co/article/222-the-search-widget', __('Learn more&hellip;', 'gravityview' ), 'target=_blank' );
215
+				esc_html_e( 'To have a search performed on an embedded View, enter the ID of the post or page where the View is embedded.', 'gravityview' );
216
+				echo ' ' . gravityview_get_link( 'http://docs.gravityview.co/article/222-the-search-widget', __( 'Learn more&hellip;', 'gravityview' ), 'target=_blank' );
217 217
 				?></span>
218 218
 		</p>
219 219
 
220 220
 		<p>
221
-			<label for="<?php echo $this->get_field_id('search_clear'); ?>"><?php esc_html_e( 'Show Clear button', 'gravityview' ); ?>:</label>
222
-			<input name="<?php echo $this->get_field_name('search_clear'); ?>" type="hidden" value="0">
223
-			<input id="<?php echo $this->get_field_id('search_clear'); ?>" name="<?php echo $this->get_field_name('search_clear'); ?>" type="checkbox" class="checkbox" value="1" <?php checked( $search_clear, 1, true ); ?>>
221
+			<label for="<?php echo $this->get_field_id( 'search_clear' ); ?>"><?php esc_html_e( 'Show Clear button', 'gravityview' ); ?>:</label>
222
+			<input name="<?php echo $this->get_field_name( 'search_clear' ); ?>" type="hidden" value="0">
223
+			<input id="<?php echo $this->get_field_id( 'search_clear' ); ?>" name="<?php echo $this->get_field_name( 'search_clear' ); ?>" type="checkbox" class="checkbox" value="1" <?php checked( $search_clear, 1, true ); ?>>
224 224
 		</p>
225 225
 
226 226
 		<p>
227 227
 			<label><?php esc_html_e( 'Search Mode', 'gravityview' ); ?>:</label>
228
-			<label for="<?php echo $this->get_field_id('search_mode'); ?>_any">
229
-				<input id="<?php echo $this->get_field_id('search_mode'); ?>_any" name="<?php echo $this->get_field_name('search_mode'); ?>" type="radio" class="radio" value="any" <?php checked( $search_mode, 'any', true ); ?>>
228
+			<label for="<?php echo $this->get_field_id( 'search_mode' ); ?>_any">
229
+				<input id="<?php echo $this->get_field_id( 'search_mode' ); ?>_any" name="<?php echo $this->get_field_name( 'search_mode' ); ?>" type="radio" class="radio" value="any" <?php checked( $search_mode, 'any', true ); ?>>
230 230
 				<?php esc_html_e( 'Match Any Fields', 'gravityview' ); ?>
231 231
 			</label>
232
-			<label for="<?php echo $this->get_field_id('search_mode'); ?>_all">
233
-				<input id="<?php echo $this->get_field_id('search_mode'); ?>_all" name="<?php echo $this->get_field_name('search_mode'); ?>" type="radio" class="radio" value="all" <?php checked( $search_mode, 'all', true ); ?>>
232
+			<label for="<?php echo $this->get_field_id( 'search_mode' ); ?>_all">
233
+				<input id="<?php echo $this->get_field_id( 'search_mode' ); ?>_all" name="<?php echo $this->get_field_name( 'search_mode' ); ?>" type="radio" class="radio" value="all" <?php checked( $search_mode, 'all', true ); ?>>
234 234
 				<?php esc_html_e( 'Match All Fields', 'gravityview' ); ?>
235 235
 			</label>
236
-			<span class="howto"><?php esc_html_e('Should search results match all search fields, or any?', 'gravityview' ); ?></span
236
+			<span class="howto"><?php esc_html_e( 'Should search results match all search fields, or any?', 'gravityview' ); ?></span
237 237
 		</p>
238 238
 
239 239
 		<hr />
240 240
 
241 241
 		<?php // @todo: move style to CSS ?>
242 242
 		<div style="margin-bottom: 1em;">
243
-			<label class="screen-reader-text" for="<?php echo $this->get_field_id('search_fields'); ?>"><?php _e( 'Searchable fields:', 'gravityview' ); ?></label>
244
-			<div class="gv-widget-search-fields" title="<?php esc_html_e('Search Fields', 'gravityview'); ?>">
245
-				<input id="<?php echo $this->get_field_id('search_fields'); ?>" name="<?php echo $this->get_field_name('search_fields'); ?>" type="hidden" value="<?php echo esc_attr( $search_fields ); ?>" class="gv-search-fields-value">
243
+			<label class="screen-reader-text" for="<?php echo $this->get_field_id( 'search_fields' ); ?>"><?php _e( 'Searchable fields:', 'gravityview' ); ?></label>
244
+			<div class="gv-widget-search-fields" title="<?php esc_html_e( 'Search Fields', 'gravityview' ); ?>">
245
+				<input id="<?php echo $this->get_field_id( 'search_fields' ); ?>" name="<?php echo $this->get_field_name( 'search_fields' ); ?>" type="hidden" value="<?php echo esc_attr( $search_fields ); ?>" class="gv-search-fields-value">
246 246
 			</div>
247 247
 
248 248
 		</div>
Please login to merge, or discard this patch.
includes/connector-functions.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
  * @param  mixed $field_id Field ID or Field array
290 290
  * @return string field type
291 291
  */
292
-function gravityview_get_field_type(  $form = null , $field_id = '' ) {
293
-	return GVCommon::get_field_type(  $form, $field_id );
292
+function gravityview_get_field_type( $form = null, $field_id = '' ) {
293
+	return GVCommon::get_field_type( $form, $field_id );
294 294
 }
295 295
 
296 296
 
@@ -303,8 +303,8 @@  discard block
 block discarded – undo
303 303
  * @return string HTML of the output. Empty string if $view_id is empty.
304 304
  */
305 305
 function get_gravityview( $view_id = '', $atts = array() ) {
306
-	if( !empty( $view_id ) ) {
307
-		$atts['id'] = $view_id;
306
+	if ( ! empty( $view_id ) ) {
307
+		$atts[ 'id' ] = $view_id;
308 308
 		$args = wp_parse_args( $atts, GravityView_View_Data::get_default_args() );
309 309
 		$GravityView_frontend = GravityView_frontend::getInstance();
310 310
 		$GravityView_frontend->setGvOutputData( GravityView_View_Data::getInstance( $view_id ) );
@@ -347,19 +347,19 @@  discard block
 block discarded – undo
347 347
  */
348 348
 function gravityview_view_has_single_checkbox_or_radio( $form, $view_fields ) {
349 349
 
350
-	if( $form_fields = GFFormsModel::get_fields_by_type( $form, array( 'checkbox', 'radio' ) ) ) {
350
+	if ( $form_fields = GFFormsModel::get_fields_by_type( $form, array( 'checkbox', 'radio' ) ) ) {
351 351
 
352 352
 		/** @var GF_Field_Radio|GF_Field_Checkbox $form_field */
353
-		foreach( $form_fields as $form_field ) {
353
+		foreach ( $form_fields as $form_field ) {
354 354
 			$field_id = $form_field->id;
355
-			foreach( $view_fields as $zone ) {
355
+			foreach ( $view_fields as $zone ) {
356 356
 
357 357
 				// ACF compatibility; ACF-added fields aren't arrays
358 358
 				if ( ! is_array( $zone ) ) { continue; }
359 359
 
360
-				foreach( $zone as $field ) {
360
+				foreach ( $zone as $field ) {
361 361
 					// If it's an input, not the parent and the parent ID matches a checkbox or radio
362
-					if( ( strpos( $field['id'], '.' ) > 0 ) && floor( $field['id'] ) === floor( $field_id ) ) {
362
+					if ( ( strpos( $field[ 'id' ], '.' ) > 0 ) && floor( $field[ 'id' ] ) === floor( $field_id ) ) {
363 363
 						return true;
364 364
 					}
365 365
 				}
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,7 +41,6 @@  discard block
 block discarded – undo
41 41
  *
42 42
  * @see GVCommon::get_forms()
43 43
  * @access public
44
- * @param mixed $form_id
45 44
  * @return array Empty array if GFAPI isn't available or no forms. Otherwise, associative array with id, title keys
46 45
  */
47 46
 function gravityview_get_forms() {
@@ -53,7 +52,7 @@  discard block
 block discarded – undo
53 52
  *
54 53
  * @see GVCommon::get_form_fields()
55 54
  * @access public
56
- * @param string|array $form_id (default: '') or $form object
55
+ * @param string|array $form (default: '') or $form object
57 56
  * @return array
58 57
  */
59 58
 function gravityview_get_form_fields( $form = '', $add_default_properties = false, $include_parent_field = true ) {
@@ -91,6 +90,7 @@  discard block
 block discarded – undo
91 90
  * @param int|array $form_ids The ID of the form or an array IDs of the Forms. Zero for all forms.
92 91
  * @param mixed $passed_criteria (default: null)
93 92
  * @param mixed &$total (default: null)
93
+ * @param integer $total
94 94
  * @return mixed False: Error fetching entries. Array: Multi-dimensional array of Gravity Forms entry arrays
95 95
  */
96 96
 function gravityview_get_entries( $form_ids = null, $passed_criteria = null, &$total = null ) {
@@ -103,7 +103,6 @@  discard block
 block discarded – undo
103 103
  * Since 1.4, supports custom entry slugs. The way that GravityView fetches an entry based on the custom slug is by searching `gravityview_unique_id` meta. The `$entry_slug` is fetched by getting the current query var set by `is_single_entry()`
104 104
  *
105 105
  * @access public
106
- * @param mixed $entry_id
107 106
  * @param boolean $force_allow_ids Force the get_entry() method to allow passed entry IDs, even if the `gravityview_custom_entry_slug_allow_id` filter returns false.
108 107
  * @param boolean $check_entry_display Check whether the entry is visible for the current View configuration. Default: true {@since 1.14}
109 108
  * @return array|boolean
@@ -190,7 +189,6 @@  discard block
 block discarded – undo
190 189
  *
191 190
  * @see GravityView_Template::template_id
192 191
  *
193
- * @param int $view_id The ID of the View to get the layout of
194 192
  *
195 193
  * @return string GravityView_Template::template_id value. Empty string if not.
196 194
  */
Please login to merge, or discard this patch.