Completed
Pull Request — develop (#843)
by Zack
05:39
created
includes/fields/class-gravityview-field-is-fulfilled.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	public function get_content( $output, $entry = array(), $field_settings = array(), $field = array() ) {
60 60
 
61 61
 		/** Overridden by a template. */
62
-		if( ! empty( $field['field_path'] ) ) { return $output; }
62
+		if ( ! empty( $field[ 'field_path' ] ) ) { return $output; }
63 63
 
64 64
 		return $this->get_string_from_value( $output );
65 65
 	}
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 		switch ( intval( $value ) ) {
79 79
 			case self::NOT_FULFILLED:
80 80
 			default:
81
-				$return = __('Not Fulfilled', 'gravityview');
81
+				$return = __( 'Not Fulfilled', 'gravityview' );
82 82
 				break;
83 83
 
84 84
 			case self::FULFILLED:
85
-				$return = __('Fulfilled', 'gravityview');
85
+				$return = __( 'Fulfilled', 'gravityview' );
86 86
 				break;
87 87
 		}
88 88
 
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
 	 *
103 103
 	 * @return string Original text if {is_fulfilled} isn't found. Otherwise, "Not Fulfilled" or "Fulfilled"
104 104
 	 */
105
-	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false  ) {
105
+	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
106 106
 
107 107
 		$return = $text;
108 108
 
109 109
 		foreach ( $matches as $match ) {
110 110
 
111
-			$full_tag = $match[0];
111
+			$full_tag = $match[ 0 ];
112 112
 
113 113
 			$fulfilled = rgar( $entry, 'is_fulfilled' );
114 114
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-category.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 	var $is_searchable = true;
13 13
 
14
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
14
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
15 15
 
16 16
 	var $_gf_field_class_name = 'GF_Field_Post_Category';
17 17
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		$entry = GFAPI::get_entry( $entry_id );
45 45
 		$post_id = rgar( $entry, 'post_id' );
46 46
 
47
-		if( empty( $post_id ) ) {
47
+		if ( empty( $post_id ) ) {
48 48
 			return false;
49 49
 		}
50 50
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 		$post_category_fields = GFAPI::get_fields_by_type( $form, 'post_category' );
54 54
 
55
-		if( $post_category_fields ) {
55
+		if ( $post_category_fields ) {
56 56
 
57 57
 			$updated_categories = array();
58 58
 
@@ -119,18 +119,18 @@  discard block
 block discarded – undo
119 119
 	 *
120 120
 	 * @return mixed
121 121
 	 */
122
-	function edit_entry_post_category_choices( $choices, $field, $form_id  ) {
122
+	function edit_entry_post_category_choices( $choices, $field, $form_id ) {
123 123
 
124
-		$entry = GravityView_Edit_Entry::getInstance()->instances['render']->get_entry();
124
+		$entry = GravityView_Edit_Entry::getInstance()->instances[ 'render' ]->get_entry();
125 125
 
126 126
 		// $entry['post_id'] should always be set, but we check to make sure.
127
-		if( $entry && isset( $entry['post_id'] ) && $post_id = $entry['post_id'] ) {
127
+		if ( $entry && isset( $entry[ 'post_id' ] ) && $post_id = $entry[ 'post_id' ] ) {
128 128
 
129 129
 			$post_categories = wp_get_post_categories( $post_id, array( 'fields' => 'ids' ) );
130 130
 
131 131
 			// Always use the live value
132 132
 			foreach ( $choices as &$choice ) {
133
-				$choice['isSelected'] = in_array( $choice['value'], array_values( $post_categories ) );
133
+				$choice[ 'isSelected' ] = in_array( $choice[ 'value' ], array_values( $post_categories ) );
134 134
 			}
135 135
 		}
136 136
 
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
 
140 140
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
141 141
 
142
-		if( 'edit' === $context ) {
142
+		if ( 'edit' === $context ) {
143 143
 			return $field_options;
144 144
 		}
145 145
 
146
-		$this->add_field_support('dynamic_data', $field_options );
147
-		$this->add_field_support('link_to_term', $field_options );
146
+		$this->add_field_support( 'dynamic_data', $field_options );
147
+		$this->add_field_support( 'link_to_term', $field_options );
148 148
 
149 149
 		return $field_options;
150 150
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-tags.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 	var $is_searchable = true;
16 16
 
17
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
17
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
18 18
 
19 19
 	var $_gf_field_class_name = 'GF_Field_Post_Tags';
20 20
 
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 
28 28
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
29 29
 
30
-		if( 'edit' === $context ) {
30
+		if ( 'edit' === $context ) {
31 31
 			return $field_options;
32 32
 		}
33 33
 
34
-		$this->add_field_support('dynamic_data', $field_options );
35
-		$this->add_field_support('link_to_term', $field_options );
34
+		$this->add_field_support( 'dynamic_data', $field_options );
35
+		$this->add_field_support( 'link_to_term', $field_options );
36 36
 
37 37
 		return $field_options;
38 38
 	}
Please login to merge, or discard this patch.
includes/class-api.php 1 patch
Spacing   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -30,29 +30,29 @@  discard block
 block discarded – undo
30 30
 
31 31
 		$label = '';
32 32
 
33
-		if( !empty( $field['show_label'] ) || $force_show_label ) {
33
+		if ( ! empty( $field[ 'show_label' ] ) || $force_show_label ) {
34 34
 
35
-			$label = $field['label'];
35
+			$label = $field[ 'label' ];
36 36
 
37 37
 			// Support Gravity Forms 1.9+
38
-			if( class_exists( 'GF_Field' ) ) {
38
+			if ( class_exists( 'GF_Field' ) ) {
39 39
 
40
-				$field_object = RGFormsModel::get_field( $form, $field['id'] );
40
+				$field_object = RGFormsModel::get_field( $form, $field[ 'id' ] );
41 41
 
42
-				if( $field_object ) {
42
+				if ( $field_object ) {
43 43
 
44
-					$input = GFFormsModel::get_input( $field_object, $field['id'] );
44
+					$input = GFFormsModel::get_input( $field_object, $field[ 'id' ] );
45 45
 
46 46
 					// This is a complex field, with labels on a per-input basis
47
-					if( $input ) {
47
+					if ( $input ) {
48 48
 
49 49
 						// Does the input have a custom label on a per-input basis? Otherwise, default label.
50
-						$label = ! empty( $input['customLabel'] ) ? $input['customLabel'] : $input['label'];
50
+						$label = ! empty( $input[ 'customLabel' ] ) ? $input[ 'customLabel' ] : $input[ 'label' ];
51 51
 
52 52
 					} else {
53 53
 
54 54
 						// This is a field with one label
55
-						$label = $field_object->get_field_label( true, $field['label'] );
55
+						$label = $field_object->get_field_label( true, $field[ 'label' ] );
56 56
 
57 57
 					}
58 58
 
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 			}
62 62
 
63 63
 			// Use Gravity Forms label by default, but if a custom label is defined in GV, use it.
64
-			if ( !empty( $field['custom_label'] ) ) {
64
+			if ( ! empty( $field[ 'custom_label' ] ) ) {
65 65
 
66
-				$label = self::replace_variables( $field['custom_label'], $form, $entry );
66
+				$label = self::replace_variables( $field[ 'custom_label' ], $form, $entry );
67 67
 
68 68
 			}
69 69
 
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
 
118 118
 		$width = NULL;
119 119
 
120
-		if( !empty( $field['width'] ) ) {
121
-			$width = absint( $field['width'] );
120
+		if ( ! empty( $field[ 'width' ] ) ) {
121
+			$width = absint( $field[ 'width' ] );
122 122
 
123 123
 			// If using percentages, limit to 100%
124
-			if( '%d%%' === $format && $width > 100 ) {
124
+			if ( '%d%%' === $format && $width > 100 ) {
125 125
 				$width = 100;
126 126
 			}
127 127
 
@@ -144,39 +144,39 @@  discard block
 block discarded – undo
144 144
 
145 145
 		$classes = array();
146 146
 
147
-		if( !empty( $field['custom_class'] ) ) {
147
+		if ( ! empty( $field[ 'custom_class' ] ) ) {
148 148
 
149
-            $custom_class = $field['custom_class'];
149
+            $custom_class = $field[ 'custom_class' ];
150 150
 
151
-            if( !empty( $entry ) ) {
151
+            if ( ! empty( $entry ) ) {
152 152
 
153 153
                 // We want the merge tag to be formatted as a class. The merge tag may be
154 154
                 // replaced by a multiple-word value that should be output as a single class.
155 155
                 // "Office Manager" will be formatted as `.OfficeManager`, not `.Office` and `.Manager`
156
-                add_filter('gform_merge_tag_filter', 'sanitize_html_class');
156
+                add_filter( 'gform_merge_tag_filter', 'sanitize_html_class' );
157 157
 
158
-                $custom_class = self::replace_variables( $custom_class, $form, $entry);
158
+                $custom_class = self::replace_variables( $custom_class, $form, $entry );
159 159
 
160 160
                 // And then we want life to return to normal
161
-                remove_filter('gform_merge_tag_filter', 'sanitize_html_class');
161
+                remove_filter( 'gform_merge_tag_filter', 'sanitize_html_class' );
162 162
             }
163 163
 
164 164
 			// And now we want the spaces to be handled nicely.
165
-			$classes[] = gravityview_sanitize_html_class( $custom_class );
165
+			$classes[ ] = gravityview_sanitize_html_class( $custom_class );
166 166
 
167 167
 		}
168 168
 
169
-		if(!empty($field['id'])) {
170
-			if( !empty( $form ) && !empty( $form['id'] ) ) {
171
-				$form_id = '-'.$form['id'];
169
+		if ( ! empty( $field[ 'id' ] ) ) {
170
+			if ( ! empty( $form ) && ! empty( $form[ 'id' ] ) ) {
171
+				$form_id = '-' . $form[ 'id' ];
172 172
 			} else {
173
-				$form_id = $gravityview_view->getFormId() ? '-'. $gravityview_view->getFormId() : '';
173
+				$form_id = $gravityview_view->getFormId() ? '-' . $gravityview_view->getFormId() : '';
174 174
 			}
175 175
 
176
-			$classes[] = 'gv-field'.$form_id.'-'.$field['id'];
176
+			$classes[ ] = 'gv-field' . $form_id . '-' . $field[ 'id' ];
177 177
 		}
178 178
 
179
-		return esc_attr(implode(' ', $classes));
179
+		return esc_attr( implode( ' ', $classes ) );
180 180
 	}
181 181
 
182 182
 	/**
@@ -193,16 +193,16 @@  discard block
 block discarded – undo
193 193
 	 */
194 194
 	public static function field_html_attr_id( $field, $form = array(), $entry = array() ) {
195 195
 		$gravityview_view = GravityView_View::getInstance();
196
-		$id = $field['id'];
196
+		$id = $field[ 'id' ];
197 197
 
198 198
 		if ( ! empty( $id ) ) {
199
-			if ( ! empty( $form ) && ! empty( $form['id'] ) ) {
200
-				$form_id = '-' . $form['id'];
199
+			if ( ! empty( $form ) && ! empty( $form[ 'id' ] ) ) {
200
+				$form_id = '-' . $form[ 'id' ];
201 201
 			} else {
202 202
 				$form_id = $gravityview_view->getFormId() ? '-' . $gravityview_view->getFormId() : '';
203 203
 			}
204 204
 
205
-			$id = 'gv-field' . $form_id . '-' . $field['id'];
205
+			$id = 'gv-field' . $form_id . '-' . $field[ 'id' ];
206 206
 		}
207 207
 
208 208
 		return esc_attr( $id );
@@ -219,17 +219,17 @@  discard block
 block discarded – undo
219 219
 	 */
220 220
 	public static function field_value( $entry, $field_settings, $format = 'html' ) {
221 221
 
222
-		if( empty( $entry['form_id'] ) || empty( $field_settings['id'] ) ) {
222
+		if ( empty( $entry[ 'form_id' ] ) || empty( $field_settings[ 'id' ] ) ) {
223 223
 			return NULL;
224 224
 		}
225 225
 
226 226
 		$gravityview_view = GravityView_View::getInstance();
227 227
 
228
-		$field_id = $field_settings['id'];
228
+		$field_id = $field_settings[ 'id' ];
229 229
 		$form = $gravityview_view->getForm();
230 230
 		$field = gravityview_get_field( $form, $field_id );
231 231
 
232
-		if( $field && is_numeric( $field_id ) ) {
232
+		if ( $field && is_numeric( $field_id ) ) {
233 233
 			// Used as file name of field template in GV.
234 234
 			// Don't use RGFormsModel::get_input_type( $field ); we don't care if it's a radio input; we want to know it's a 'quiz' field
235 235
 			$field_type = $field->type;
@@ -240,12 +240,12 @@  discard block
 block discarded – undo
240 240
 		}
241 241
 
242 242
 		// If a Gravity Forms Field is found, get the field display
243
-		if( $field ) {
243
+		if ( $field ) {
244 244
 
245 245
 			// Prevent any PHP warnings that may be generated
246 246
 			ob_start();
247 247
 
248
-			$display_value = GFCommon::get_lead_field_display( $field, $value, $entry["currency"], false, $format );
248
+			$display_value = GFCommon::get_lead_field_display( $field, $value, $entry[ "currency" ], false, $format );
249 249
 
250 250
 			if ( $errors = ob_get_clean() ) {
251 251
 				do_action( 'gravityview_log_error', 'GravityView_API[field_value] Errors when calling GFCommon::get_lead_field_display()', $errors );
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 			$display_value = apply_filters( "gform_entry_field_value", $display_value, $field, $entry, $form );
255 255
 
256 256
 			// prevent the use of merge_tags for non-admin fields
257
-			if( !empty( $field->adminOnly ) ) {
257
+			if ( ! empty( $field->adminOnly ) ) {
258 258
 				$display_value = self::replace_variables( $display_value, $form, $entry );
259 259
 			}
260 260
 		} else {
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
 		// Check whether the field exists in /includes/fields/{$field_type}.php
266 266
 		// This can be overridden by user template files.
267
-		$field_path = $gravityview_view->locate_template("fields/{$field_type}.php");
267
+		$field_path = $gravityview_view->locate_template( "fields/{$field_type}.php" );
268 268
 
269 269
 		// Set the field data to be available in the templates
270 270
 		$gravityview_view->setCurrentField( array(
@@ -278,11 +278,11 @@  discard block
 block discarded – undo
278 278
 			'entry' => $entry,
279 279
 			'field_type' => $field_type, /** {@since 1.6} */
280 280
 		    'field_path' => $field_path, /** {@since 1.16} */
281
-		));
281
+		) );
282 282
 
283
-		if( ! empty( $field_path ) ) {
283
+		if ( ! empty( $field_path ) ) {
284 284
 
285
-			do_action( 'gravityview_log_debug', sprintf('[field_value] Rendering %s', $field_path ) );
285
+			do_action( 'gravityview_log_debug', sprintf( '[field_value] Rendering %s', $field_path ) );
286 286
 
287 287
 			ob_start();
288 288
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 		}
299 299
 
300 300
 		// Get the field settings again so that the field template can override the settings
301
-		$field_settings = $gravityview_view->getCurrentField('field_settings');
301
+		$field_settings = $gravityview_view->getCurrentField( 'field_settings' );
302 302
 
303 303
 		/**
304 304
 		 * @filter `gravityview_field_entry_value_{$field_type}_pre_link` Modify the field value output for a field type before Show As Link setting is applied. Example: `gravityview_field_entry_value_number_pre_link`
@@ -316,9 +316,9 @@  discard block
 block discarded – undo
316 316
 		 * Fields can override this by modifying the field data variable inside the field. See /templates/fields/post_image.php for an example.
317 317
 		 *
318 318
 		 */
319
-		if( !empty( $field_settings['show_as_link'] ) && ! gv_empty( $output, false, false ) ) {
319
+		if ( ! empty( $field_settings[ 'show_as_link' ] ) && ! gv_empty( $output, false, false ) ) {
320 320
 
321
-			$link_atts = empty( $field_settings['new_window'] ) ? array() : array( 'target' => '_blank' );
321
+			$link_atts = empty( $field_settings[ 'new_window' ] ) ? array() : array( 'target' => '_blank' );
322 322
 
323 323
 			$output = self::entry_link_html( $entry, $output, $link_atts, $field_settings );
324 324
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 		 * @param  array $field_settings Settings for the particular GV field
333 333
 		 * @param array $field Current field being displayed
334 334
 		 */
335
-		$output = apply_filters( 'gravityview_field_entry_value_'.$field_type, $output, $entry, $field_settings, $gravityview_view->getCurrentField() );
335
+		$output = apply_filters( 'gravityview_field_entry_value_' . $field_type, $output, $entry, $field_settings, $gravityview_view->getCurrentField() );
336 336
 
337 337
 		/**
338 338
 		 * @filter `gravityview_field_entry_value` Modify the field value output for all field types
@@ -361,14 +361,14 @@  discard block
 block discarded – undo
361 361
 	 */
362 362
 	public static function entry_link_html( $entry = array(), $anchor_text = '', $passed_tag_atts = array(), $field_settings = array() ) {
363 363
 
364
-		if ( empty( $entry ) || ! is_array( $entry ) || ! isset( $entry['id'] ) ) {
364
+		if ( empty( $entry ) || ! is_array( $entry ) || ! isset( $entry[ 'id' ] ) ) {
365 365
 			do_action( 'gravityview_log_debug', 'GravityView_API[entry_link_tag] Entry not defined; returning null', $entry );
366 366
 			return NULL;
367 367
 		}
368 368
 
369 369
 		$href = self::entry_link( $entry );
370 370
 
371
-		if( '' === $href ) {
371
+		if ( '' === $href ) {
372 372
 			return NULL;
373 373
 		}
374 374
 
@@ -391,19 +391,19 @@  discard block
 block discarded – undo
391 391
 	 * @param  boolean     $wpautop Apply wpautop() to the output?
392 392
 	 * @return string               HTML of "no results" text
393 393
 	 */
394
-	public static function no_results($wpautop = true) {
394
+	public static function no_results( $wpautop = true ) {
395 395
 		$gravityview_view = GravityView_View::getInstance();
396 396
 
397 397
 		$is_search = false;
398 398
 
399
-		if( $gravityview_view && ( $gravityview_view->curr_start || $gravityview_view->curr_end || $gravityview_view->curr_search ) ) {
399
+		if ( $gravityview_view && ( $gravityview_view->curr_start || $gravityview_view->curr_end || $gravityview_view->curr_search ) ) {
400 400
 			$is_search = true;
401 401
 		}
402 402
 
403
-		if($is_search) {
404
-			$output = __('This search returned no results.', 'gravityview');
403
+		if ( $is_search ) {
404
+			$output = __( 'This search returned no results.', 'gravityview' );
405 405
 		} else {
406
-			$output = __('No entries match your request.', 'gravityview');
406
+			$output = __( 'No entries match your request.', 'gravityview' );
407 407
 		}
408 408
 
409 409
 		/**
@@ -411,9 +411,9 @@  discard block
 block discarded – undo
411 411
 		 * @param string $output The existing "No Entries" text
412 412
 		 * @param boolean $is_search Is the current page a search result, or just a multiple entries screen?
413 413
 		 */
414
-		$output = apply_filters( 'gravitview_no_entries_text', $output, $is_search);
414
+		$output = apply_filters( 'gravitview_no_entries_text', $output, $is_search );
415 415
 
416
-		return $wpautop ? wpautop($output) : $output;
416
+		return $wpautop ? wpautop( $output ) : $output;
417 417
 	}
418 418
 
419 419
 	/**
@@ -430,37 +430,37 @@  discard block
 block discarded – undo
430 430
 
431 431
 		$gravityview_view = GravityView_View::getInstance();
432 432
 
433
-		if( empty( $post_id ) ) {
433
+		if ( empty( $post_id ) ) {
434 434
 
435 435
 			$post_id = false;
436 436
 
437 437
 			// DataTables passes the Post ID
438
-			if( defined('DOING_AJAX') && DOING_AJAX ) {
438
+			if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
439 439
 
440
-				$post_id = isset( $_POST['post_id'] ) ? (int)$_POST['post_id'] : false;
440
+				$post_id = isset( $_POST[ 'post_id' ] ) ? (int)$_POST[ 'post_id' ] : false;
441 441
 
442 442
 			} else {
443 443
 
444 444
 				// The Post ID has been passed via the shortcode
445
-				if( !empty( $gravityview_view ) && $gravityview_view->getPostId() ) {
445
+				if ( ! empty( $gravityview_view ) && $gravityview_view->getPostId() ) {
446 446
 
447 447
 					$post_id = $gravityview_view->getPostId();
448 448
 
449 449
 				} else {
450 450
 
451 451
 					// This is a GravityView post type
452
-					if( GravityView_frontend::getInstance()->isGravityviewPostType() ) {
452
+					if ( GravityView_frontend::getInstance()->isGravityviewPostType() ) {
453 453
 
454 454
 						$post_id = isset( $gravityview_view ) ? $gravityview_view->getViewId() : $post->ID;
455 455
 
456 456
 					} else {
457 457
 
458 458
 						// This is an embedded GravityView; use the embedded post's ID as the base.
459
-						if( GravityView_frontend::getInstance()->isPostHasShortcode() && is_a( $post, 'WP_Post' ) ) {
459
+						if ( GravityView_frontend::getInstance()->isPostHasShortcode() && is_a( $post, 'WP_Post' ) ) {
460 460
 
461 461
 							$post_id = $post->ID;
462 462
 
463
-						} elseif( $gravityview_view->getViewId() ) {
463
+						} elseif ( $gravityview_view->getViewId() ) {
464 464
 
465 465
 							// The GravityView has been embedded in a widget or in a template, and
466 466
 							// is not in the current content. Thus, we defer to the View's own ID.
@@ -475,36 +475,36 @@  discard block
 block discarded – undo
475 475
 		}
476 476
 
477 477
 		// No post ID, get outta here.
478
-		if( empty( $post_id ) ) {
478
+		if ( empty( $post_id ) ) {
479 479
 			return NULL;
480 480
 		}
481 481
 
482 482
 		// If we've saved the permalink in memory, use it
483 483
 		// @since 1.3
484
-		$link = wp_cache_get( 'gv_directory_link_'.$post_id );
484
+		$link = wp_cache_get( 'gv_directory_link_' . $post_id );
485 485
 
486
-		if( empty( $link ) ) {
486
+		if ( empty( $link ) ) {
487 487
 
488 488
 			$link = get_permalink( $post_id );
489 489
 
490 490
 			// If not yet saved, cache the permalink.
491 491
 			// @since 1.3
492
-			wp_cache_set( 'gv_directory_link_'.$post_id, $link );
492
+			wp_cache_set( 'gv_directory_link_' . $post_id, $link );
493 493
 
494 494
 		}
495 495
 
496 496
 		// Deal with returning to proper pagination for embedded views
497
-		if( $link && $add_query_args ) {
497
+		if ( $link && $add_query_args ) {
498 498
 
499 499
 			$args = array();
500 500
 
501
-			if( $pagenum = rgget('pagenum') ) {
502
-				$args['pagenum'] = intval( $pagenum );
501
+			if ( $pagenum = rgget( 'pagenum' ) ) {
502
+				$args[ 'pagenum' ] = intval( $pagenum );
503 503
 			}
504 504
 
505
-			if( $sort = rgget('sort') ) {
506
-				$args['sort'] = $sort;
507
-				$args['dir'] = rgget('dir');
505
+			if ( $sort = rgget( 'sort' ) ) {
506
+				$args[ 'sort' ] = $sort;
507
+				$args[ 'dir' ] = rgget( 'dir' );
508 508
 			}
509 509
 
510 510
 			$link = add_query_arg( $args, $link );
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 	private static function get_custom_entry_slug( $id, $entry = array() ) {
536 536
 
537 537
 		// Generate an unique hash to use as the default value
538
-		$slug = substr( wp_hash( $id, 'gravityview'.$id ), 0, 8 );
538
+		$slug = substr( wp_hash( $id, 'gravityview' . $id ), 0, 8 );
539 539
 
540 540
 		/**
541 541
 		 * @filter `gravityview_entry_slug` Modify the unique hash ID generated, if you want to improve usability or change the format. This will allow for custom URLs, such as `{entryid}-{first-name}` or even, if unique, `{first-name}-{last-name}`
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 		$slug = apply_filters( 'gravityview_entry_slug', $slug, $id, $entry );
547 547
 
548 548
 		// Make sure we have something - use the original ID as backup.
549
-		if( empty( $slug ) ) {
549
+		if ( empty( $slug ) ) {
550 550
 			$slug = $id;
551 551
 		}
552 552
 
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 		 * @filter `gravityview_custom_entry_slug` Whether to enable and use custom entry slugs.
576 576
 		 * @param boolean True: Allow for slugs based on entry values. False: always use entry IDs (default)
577 577
 		 */
578
-		$custom = apply_filters('gravityview_custom_entry_slug', false );
578
+		$custom = apply_filters( 'gravityview_custom_entry_slug', false );
579 579
 
580 580
 		// If we're using custom slug...
581 581
 		if ( $custom ) {
@@ -589,8 +589,8 @@  discard block
 block discarded – undo
589 589
 			// If it does have a hash set, and the hash is expected, use it.
590 590
 			// This check allows users to change the hash structure using the
591 591
 			// gravityview_entry_hash filter and have the old hashes expire.
592
-			if( empty( $value ) || $value !== $hash ) {
593
-				do_action( 'gravityview_log_debug', __METHOD__ . ' - Setting hash for entry "'.$id_or_string.'": ' . $hash );
592
+			if ( empty( $value ) || $value !== $hash ) {
593
+				do_action( 'gravityview_log_debug', __METHOD__ . ' - Setting hash for entry "' . $id_or_string . '": ' . $hash );
594 594
 				gform_update_meta( $id_or_string, 'gravityview_unique_id', $hash, rgar( $entry, 'form_id' ) );
595 595
 			}
596 596
 
@@ -616,15 +616,15 @@  discard block
 block discarded – undo
616 616
          * @param boolean $custom Should we process the custom entry slug?
617 617
          */
618 618
         $custom = apply_filters( 'gravityview_custom_entry_slug', false );
619
-        if( $custom ) {
619
+        if ( $custom ) {
620 620
             // create the gravityview_unique_id and save it
621 621
 
622 622
             // Get the entry hash
623
-            $hash = self::get_custom_entry_slug( $entry['id'], $entry );
623
+            $hash = self::get_custom_entry_slug( $entry[ 'id' ], $entry );
624 624
 
625
-	        do_action( 'gravityview_log_debug', __METHOD__ . ' - Setting hash for entry "'.$entry['id'].'": ' . $hash );
625
+	        do_action( 'gravityview_log_debug', __METHOD__ . ' - Setting hash for entry "' . $entry[ 'id' ] . '": ' . $hash );
626 626
 
627
-            gform_update_meta( $entry['id'], 'gravityview_unique_id', $hash, rgar( $entry, 'form_id' ) );
627
+            gform_update_meta( $entry[ 'id' ], 'gravityview_unique_id', $hash, rgar( $entry, 'form_id' ) );
628 628
 
629 629
         }
630 630
     }
@@ -641,14 +641,14 @@  discard block
 block discarded – undo
641 641
 	 */
642 642
 	public static function entry_link( $entry, $post_id = NULL, $add_directory_args = true ) {
643 643
 
644
-		if( ! empty( $entry ) && ! is_array( $entry ) ) {
644
+		if ( ! empty( $entry ) && ! is_array( $entry ) ) {
645 645
 			$entry = GVCommon::get_entry( $entry );
646
-		} else if( empty( $entry ) ) {
646
+		} else if ( empty( $entry ) ) {
647 647
 			$entry = GravityView_frontend::getInstance()->getEntry();
648 648
 		}
649 649
 
650 650
 		// Second parameter used to be passed as $field; this makes sure it's not an array
651
-		if( !is_numeric( $post_id ) ) {
651
+		if ( ! is_numeric( $post_id ) ) {
652 652
 			$post_id = NULL;
653 653
 		}
654 654
 
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 		$directory_link = self::directory_link( $post_id, false );
657 657
 
658 658
 		// No post ID? Get outta here.
659
-		if( empty( $directory_link ) ) {
659
+		if ( empty( $directory_link ) ) {
660 660
 			return '';
661 661
 		}
662 662
 
@@ -667,9 +667,9 @@  discard block
 block discarded – undo
667 667
 			$query_arg_name = GravityView_Post_Types::get_entry_var_name();
668 668
 		}
669 669
 
670
-		$entry_slug = self::get_entry_slug( $entry['id'], $entry );
670
+		$entry_slug = self::get_entry_slug( $entry[ 'id' ], $entry );
671 671
 
672
-		if( get_option('permalink_structure') && !is_preview() ) {
672
+		if ( get_option( 'permalink_structure' ) && ! is_preview() ) {
673 673
 
674 674
 			$args = array();
675 675
 
@@ -679,9 +679,9 @@  discard block
 block discarded – undo
679 679
 			 */
680 680
 			$link_parts = explode( '?', $directory_link );
681 681
 
682
-			$query = !empty( $link_parts[1] ) ? '?'.$link_parts[1] : '';
682
+			$query = ! empty( $link_parts[ 1 ] ) ? '?' . $link_parts[ 1 ] : '';
683 683
 
684
-			$directory_link = trailingslashit( $link_parts[0] ) . $query_arg_name . '/'. $entry_slug .'/' . $query;
684
+			$directory_link = trailingslashit( $link_parts[ 0 ] ) . $query_arg_name . '/' . $entry_slug . '/' . $query;
685 685
 
686 686
 		} else {
687 687
 
@@ -691,18 +691,18 @@  discard block
 block discarded – undo
691 691
 		/**
692 692
 		 * @since 1.7.3
693 693
 		 */
694
-		if( $add_directory_args ) {
694
+		if ( $add_directory_args ) {
695 695
 
696
-			if( !empty( $_GET['pagenum'] ) ) {
697
-				$args['pagenum'] = intval( $_GET['pagenum'] );
696
+			if ( ! empty( $_GET[ 'pagenum' ] ) ) {
697
+				$args[ 'pagenum' ] = intval( $_GET[ 'pagenum' ] );
698 698
 			}
699 699
 
700 700
 			/**
701 701
 			 * @since 1.7
702 702
 			 */
703
-			if( $sort = rgget('sort') ) {
704
-				$args['sort'] = $sort;
705
-				$args['dir'] = rgget('dir');
703
+			if ( $sort = rgget( 'sort' ) ) {
704
+				$args[ 'sort' ] = $sort;
705
+				$args[ 'dir' ] = rgget( 'dir' );
706 706
 			}
707 707
 
708 708
 		}
@@ -712,8 +712,8 @@  discard block
 block discarded – undo
712 712
 		 * has the view id so that Advanced Filters can be applied correctly when rendering the single view
713 713
 		 * @see GravityView_frontend::get_context_view_id()
714 714
 		 */
715
-		if( class_exists( 'GravityView_View_Data' ) && GravityView_View_Data::getInstance()->has_multiple_views() ) {
716
-			$args['gvid'] = gravityview_get_view_id();
715
+		if ( class_exists( 'GravityView_View_Data' ) && GravityView_View_Data::getInstance()->has_multiple_views() ) {
716
+			$args[ 'gvid' ] = gravityview_get_view_id();
717 717
 		}
718 718
 
719 719
 		return add_query_arg( $args, $directory_link );
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 }
732 732
 
733 733
 function gv_class( $field, $form = NULL, $entry = array() ) {
734
-	return GravityView_API::field_class( $field, $form, $entry  );
734
+	return GravityView_API::field_class( $field, $form, $entry );
735 735
 }
736 736
 
737 737
 /**
@@ -753,15 +753,15 @@  discard block
 block discarded – undo
753 753
 
754 754
 	$default_css_class = ! empty( $view_id ) ? sprintf( 'gv-container gv-container-%d', $view_id ) : 'gv-container';
755 755
 
756
-	if( GravityView_View::getInstance()->isHideUntilSearched() ) {
756
+	if ( GravityView_View::getInstance()->isHideUntilSearched() ) {
757 757
 		$default_css_class .= ' hidden';
758 758
 	}
759 759
 
760
-	if( 0 === GravityView_View::getInstance()->getTotalEntries() ) {
760
+	if ( 0 === GravityView_View::getInstance()->getTotalEntries() ) {
761 761
 		$default_css_class .= ' gv-container-no-results';
762 762
 	}
763 763
 
764
-	$css_class = trim( $passed_css_class . ' '. $default_css_class );
764
+	$css_class = trim( $passed_css_class . ' ' . $default_css_class );
765 765
 
766 766
 	/**
767 767
 	 * @filter `gravityview/render/container/class` Modify the CSS class to be added to the wrapper <div> of a View
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 
773 773
 	$css_class = gravityview_sanitize_html_class( $css_class );
774 774
 
775
-	if( $echo ) {
775
+	if ( $echo ) {
776 776
 		echo $css_class;
777 777
 	}
778 778
 
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 
784 784
 	$value = GravityView_API::field_value( $entry, $field );
785 785
 
786
-	if( $value === '' ) {
786
+	if ( $value === '' ) {
787 787
 		/**
788 788
 		 * @filter `gravityview_empty_value` What to display when a field is empty
789 789
 		 * @param string $value (empty string)
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 	return GravityView_API::entry_link( $entry, $post_id );
803 803
 }
804 804
 
805
-function gv_no_results($wpautop = true) {
805
+function gv_no_results( $wpautop = true ) {
806 806
 	return GravityView_API::no_results( $wpautop );
807 807
 }
808 808
 
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 	 */
824 824
 	$href = apply_filters( 'gravityview_go_back_url', $href );
825 825
 
826
-	if( empty( $href ) ) { return NULL; }
826
+	if ( empty( $href ) ) { return NULL; }
827 827
 
828 828
 	// calculate link label
829 829
 	$gravityview_view = GravityView_View::getInstance();
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 
840 840
 	$link = gravityview_get_link( $href, esc_html( $label ), array(
841 841
 		'data-viewid' => $gravityview_view->getViewId()
842
-	));
842
+	) );
843 843
 
844 844
 	return $link;
845 845
 }
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
  */
859 859
 function gravityview_get_field_value( $entry, $field_id, $display_value ) {
860 860
 
861
-	if( floatval( $field_id ) === floor( floatval( $field_id ) ) ) {
861
+	if ( floatval( $field_id ) === floor( floatval( $field_id ) ) ) {
862 862
 
863 863
 		// For the complete field value as generated by Gravity Forms
864 864
 		return $display_value;
@@ -888,16 +888,16 @@  discard block
 block discarded – undo
888 888
 
889 889
 	$terms = explode( ', ', $value );
890 890
 
891
-	foreach ($terms as $term_name ) {
891
+	foreach ( $terms as $term_name ) {
892 892
 
893 893
 		// If we're processing a category,
894
-		if( $taxonomy === 'category' ) {
894
+		if ( $taxonomy === 'category' ) {
895 895
 
896 896
 			// Use rgexplode to prevent errors if : doesn't exist
897 897
 			list( $term_name, $term_id ) = rgexplode( ':', $value, 2 );
898 898
 
899 899
 			// The explode was succesful; we have the category ID
900
-			if( !empty( $term_id )) {
900
+			if ( ! empty( $term_id ) ) {
901 901
 				$term = get_term_by( 'id', $term_id, $taxonomy );
902 902
 			} else {
903 903
 			// We have to fall back to the name
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
 		}
911 911
 
912 912
 		// There's still a tag/category here.
913
-		if( $term ) {
913
+		if ( $term ) {
914 914
 
915 915
 			$term_link = get_term_link( $term, $taxonomy );
916 916
 
@@ -919,11 +919,11 @@  discard block
 block discarded – undo
919 919
 			    continue;
920 920
 			}
921 921
 
922
-			$output[] = gravityview_get_link( $term_link, esc_html( $term->name ) );
922
+			$output[ ] = gravityview_get_link( $term_link, esc_html( $term->name ) );
923 923
 		}
924 924
 	}
925 925
 
926
-	return implode(', ', $output );
926
+	return implode( ', ', $output );
927 927
 }
928 928
 
929 929
 /**
@@ -937,8 +937,8 @@  discard block
 block discarded – undo
937 937
 
938 938
 	$output = get_the_term_list( $post_id, $taxonomy, NULL, ', ' );
939 939
 
940
-	if( empty( $link ) ) {
941
-		return strip_tags( $output);
940
+	if ( empty( $link ) ) {
941
+		return strip_tags( $output );
942 942
 	}
943 943
 
944 944
 	return $output;
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
 	$fe = GravityView_frontend::getInstance();
958 958
 
959 959
 	// Solve problem when loading content via admin-ajax.php
960
-	if( ! $fe->getGvOutputData() ) {
960
+	if ( ! $fe->getGvOutputData() ) {
961 961
 
962 962
 		do_action( 'gravityview_log_debug', '[gravityview_get_current_views] gv_output_data not defined; parsing content.' );
963 963
 
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 	}
966 966
 
967 967
 	// Make 100% sure that we're dealing with a properly called situation
968
-	if( !is_a( $fe->getGvOutputData(), 'GravityView_View_Data' ) ) {
968
+	if ( ! is_a( $fe->getGvOutputData(), 'GravityView_View_Data' ) ) {
969 969
 
970 970
 		do_action( 'gravityview_log_debug', '[gravityview_get_current_views] gv_output_data not an object or get_view not callable.', $fe->getGvOutputData() );
971 971
 
@@ -985,10 +985,10 @@  discard block
 block discarded – undo
985 985
 
986 986
 	$fe = GravityView_frontend::getInstance();
987 987
 
988
-	if( ! $fe->getGvOutputData() ) { return array(); }
988
+	if ( ! $fe->getGvOutputData() ) { return array(); }
989 989
 
990 990
 	// If not set, grab the current view ID
991
-	if( empty( $view_id ) ) {
991
+	if ( empty( $view_id ) ) {
992 992
 		$view_id = $fe->get_context_view_id();
993 993
 	}
994 994
 
@@ -1053,11 +1053,11 @@  discard block
 block discarded – undo
1053 1053
 	 */
1054 1054
 	$is_edit_entry = apply_filters( 'gravityview_is_edit_entry', false );
1055 1055
 
1056
-	if( $is_edit_entry ) {
1056
+	if ( $is_edit_entry ) {
1057 1057
 		$context = 'edit';
1058
-	} else if( class_exists( 'GravityView_frontend' ) && $single = GravityView_frontend::is_single_entry() ) {
1058
+	} else if ( class_exists( 'GravityView_frontend' ) && $single = GravityView_frontend::is_single_entry() ) {
1059 1059
 		$context = 'single';
1060
-	} else if( class_exists( 'GravityView_View' ) ) {
1060
+	} else if ( class_exists( 'GravityView_View' ) ) {
1061 1061
 		$context = GravityView_View::getInstance()->getContext();
1062 1062
 	}
1063 1063
 
@@ -1085,12 +1085,12 @@  discard block
 block discarded – undo
1085 1085
 function gravityview_get_files_array( $value, $gv_class = '' ) {
1086 1086
 	/** @define "GRAVITYVIEW_DIR" "../" */
1087 1087
 
1088
-	if( !class_exists( 'GravityView_Field' ) ) {
1089
-		include_once( GRAVITYVIEW_DIR .'includes/fields/class-gravityview-field.php' );
1088
+	if ( ! class_exists( 'GravityView_Field' ) ) {
1089
+		include_once( GRAVITYVIEW_DIR . 'includes/fields/class-gravityview-field.php' );
1090 1090
 	}
1091 1091
 
1092
-	if( !class_exists( 'GravityView_Field_FileUpload' ) ) {
1093
-		include_once( GRAVITYVIEW_DIR .'includes/fields/fileupload.php' );
1092
+	if ( ! class_exists( 'GravityView_Field_FileUpload' ) ) {
1093
+		include_once( GRAVITYVIEW_DIR . 'includes/fields/fileupload.php' );
1094 1094
 	}
1095 1095
 
1096 1096
 	return GravityView_Field_FileUpload::get_files_array( $value, $gv_class );
@@ -1168,12 +1168,12 @@  discard block
 block discarded – undo
1168 1168
 	$args = apply_filters( 'gravityview/field_output/args', $args, $passed_args );
1169 1169
 
1170 1170
 	// Required fields.
1171
-	if ( empty( $args['field'] ) || empty( $args['form'] ) ) {
1171
+	if ( empty( $args[ 'field' ] ) || empty( $args[ 'form' ] ) ) {
1172 1172
 		do_action( 'gravityview_log_error', '[gravityview_field_output] Field or form are empty.', $args );
1173 1173
 		return '';
1174 1174
 	}
1175 1175
 
1176
-	$entry = empty( $args['entry'] ) ? array() : $args['entry'];
1176
+	$entry = empty( $args[ 'entry' ] ) ? array() : $args[ 'entry' ];
1177 1177
 
1178 1178
 	/**
1179 1179
 	 * Create the content variables for replacing.
@@ -1189,37 +1189,37 @@  discard block
 block discarded – undo
1189 1189
 		'field_id' => '',
1190 1190
 	);
1191 1191
 
1192
-	$context['value'] = gv_value( $entry, $args['field'] );
1192
+	$context[ 'value' ] = gv_value( $entry, $args[ 'field' ] );
1193 1193
 
1194 1194
 	// If the value is empty and we're hiding empty, return empty.
1195
-	if ( $context['value'] === '' && ! empty( $args['hide_empty'] ) ) {
1195
+	if ( $context[ 'value' ] === '' && ! empty( $args[ 'hide_empty' ] ) ) {
1196 1196
 		return '';
1197 1197
 	}
1198 1198
 
1199
-	if ( $context['value'] !== '' && ! empty( $args['wpautop'] ) ) {
1200
-		$context['value'] = wpautop( $context['value'] );
1199
+	if ( $context[ 'value' ] !== '' && ! empty( $args[ 'wpautop' ] ) ) {
1200
+		$context[ 'value' ] = wpautop( $context[ 'value' ] );
1201 1201
 	}
1202 1202
 
1203 1203
 	// Get width setting, if exists
1204
-	$context['width'] = GravityView_API::field_width( $args['field'] );
1204
+	$context[ 'width' ] = GravityView_API::field_width( $args[ 'field' ] );
1205 1205
 
1206 1206
 	// If replacing with CSS inline formatting, let's do it.
1207
-	$context['width:style'] = GravityView_API::field_width( $args['field'], 'width:' . $context['width'] . '%;' );
1207
+	$context[ 'width:style' ] = GravityView_API::field_width( $args[ 'field' ], 'width:' . $context[ 'width' ] . '%;' );
1208 1208
 
1209 1209
 	// Grab the Class using `gv_class`
1210
-	$context['class'] = gv_class( $args['field'], $args['form'], $entry );
1211
-	$context['field_id'] = GravityView_API::field_html_attr_id( $args['field'], $args['form'], $entry );
1210
+	$context[ 'class' ] = gv_class( $args[ 'field' ], $args[ 'form' ], $entry );
1211
+	$context[ 'field_id' ] = GravityView_API::field_html_attr_id( $args[ 'field' ], $args[ 'form' ], $entry );
1212 1212
 
1213 1213
 	// Get field label if needed
1214
-	if ( ! empty( $args['label_markup'] ) && ! empty( $args['field']['show_label'] ) ) {
1215
-		$context['label'] = str_replace( array( '{{label}}', '{{ label }}' ), '<span class="gv-field-label">{{ label_value }}</span>', $args['label_markup'] );
1214
+	if ( ! empty( $args[ 'label_markup' ] ) && ! empty( $args[ 'field' ][ 'show_label' ] ) ) {
1215
+		$context[ 'label' ] = str_replace( array( '{{label}}', '{{ label }}' ), '<span class="gv-field-label">{{ label_value }}</span>', $args[ 'label_markup' ] );
1216 1216
 	}
1217 1217
 
1218 1218
 	// Default Label value
1219
-	$context['label_value'] = gv_label( $args['field'], $entry );
1219
+	$context[ 'label_value' ] = gv_label( $args[ 'field' ], $entry );
1220 1220
 
1221
-	if ( empty( $context['label'] ) && ! empty( $context['label_value'] ) ){
1222
-		$context['label'] = '<span class="gv-field-label">{{ label_value }}</span>';
1221
+	if ( empty( $context[ 'label' ] ) && ! empty( $context[ 'label_value' ] ) ) {
1222
+		$context[ 'label' ] = '<span class="gv-field-label">{{ label_value }}</span>';
1223 1223
 	}
1224 1224
 
1225 1225
 	/**
@@ -1228,7 +1228,7 @@  discard block
 block discarded – undo
1228 1228
 	 * @param string $markup The HTML for the markup
1229 1229
 	 * @param array $args All args for the field output
1230 1230
 	 */
1231
-	$html = apply_filters( 'gravityview/field_output/pre_html', $args['markup'], $args );
1231
+	$html = apply_filters( 'gravityview/field_output/pre_html', $args[ 'markup' ], $args );
1232 1232
 
1233 1233
 	/**
1234 1234
 	 * @filter `gravityview/field_output/open_tag` Modify the opening tags for the template content placeholders
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 	foreach ( $context as $tag => $value ) {
1252 1252
 
1253 1253
 		// If the tag doesn't exist just skip it
1254
-		if ( false === strpos( $html, $open_tag . $tag . $close_tag ) && false === strpos( $html, $open_tag . ' ' . $tag . ' ' . $close_tag ) ){
1254
+		if ( false === strpos( $html, $open_tag . $tag . $close_tag ) && false === strpos( $html, $open_tag . ' ' . $tag . ' ' . $close_tag ) ) {
1255 1255
 			continue;
1256 1256
 		}
1257 1257
 
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-radio.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,22 +10,22 @@
 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-radio.php - No choices for field' );
13
+if ( empty( $search_field[ 'choices' ] ) ) {
14
+	do_action( 'gravityview_log_debug', 'search-field-radio.php - No choices for field' );
15 15
 	return;
16 16
 }
17 17
 
18 18
 ?>
19 19
 <div class="gv-search-box gv-search-field-radio">
20
-	<?php if( ! gv_empty( $search_field['label'], false ) ) { ?>
21
-	<label for=search-box-<?php echo esc_attr( $search_field['name'] ); ?>><?php echo esc_html( $search_field['label'] ); ?></label>
20
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { ?>
21
+	<label for=search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
22 22
 	<?php } ?>
23 23
 	<p>
24
-	<?php foreach( $search_field['choices'] as $choice ) { ?>
24
+	<?php foreach ( $search_field[ 'choices' ] as $choice ) { ?>
25 25
 
26
-		<label for="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" class="gv-check-radio">
27
-			<input type="radio" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $choice['value'] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" <?php checked( $choice['value'], $search_field['value'], true ); ?>>
28
-			<?php echo esc_html( $choice['text'] ); ?>
26
+		<label for="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" class="gv-check-radio">
27
+			<input type="radio" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" <?php checked( $choice[ 'value' ], $search_field[ 'value' ], true ); ?>>
28
+			<?php echo esc_html( $choice[ 'text' ] ); ?>
29 29
 		</label>
30 30
 
31 31
 	<?php } ?>
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,14 +7,14 @@
 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
 
15 15
 <div class="gv-search-box gv-search-field-text gv-search-field-search_all">
16 16
 	<div class="gv-search">
17
-	<?php if( ! gv_empty( $label, false ) ) { ?>
17
+	<?php if ( ! gv_empty( $label, false ) ) { ?>
18 18
 		<label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
19 19
 	<?php } ?>
20 20
 		<p><input type="text" name="gv_search" id="gv_search_<?php echo $view_id; ?>" value="<?php echo $value; ?>" /></p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-checkbox.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,22 +10,22 @@
 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-checkbox.php - No choices for field' );
13
+if ( empty( $search_field[ 'choices' ] ) ) {
14
+	do_action( 'gravityview_log_debug', 'search-field-checkbox.php - No choices for field' );
15 15
 	return;
16 16
 }
17 17
 
18 18
 ?>
19 19
 <div class="gv-search-box gv-search-field-checkbox">
20
-	<?php if( ! gv_empty( $search_field['label'], false ) ) { ?>
21
-	<label for=search-box-<?php echo esc_attr( $search_field['name'] ); ?>><?php echo esc_html( $search_field['label'] ); ?></label>
20
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { ?>
21
+	<label for=search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
22 22
 	<?php } ?>
23 23
 	<p>
24
-	<?php foreach( $search_field['choices'] as $choice ) { ?>
24
+	<?php foreach ( $search_field[ 'choices' ] as $choice ) { ?>
25 25
 
26
-		<label for="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" class="gv-check-radio">
27
-			<input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>[]" value="<?php echo esc_attr( $choice['value'] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true, 'checked' ); ?>>
28
-			<?php echo esc_html( $choice['text'] ); ?>
26
+		<label for="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" class="gv-check-radio">
27
+			<input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>[]" value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" <?php gv_selected( $choice[ 'value' ], $search_field[ 'value' ], true, 'checked' ); ?>>
28
+			<?php echo esc_html( $choice[ 'text' ] ); ?>
29 29
 		</label>
30 30
 
31 31
 	<?php } ?>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-link.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
 $base_url = GravityView_Widget_Search::get_search_form_action();
14 14
 
15 15
 // Make sure that there are choices to display
16
-if ( empty( $search_field['choices'] ) ) {
16
+if ( empty( $search_field[ 'choices' ] ) ) {
17 17
 	do_action( 'gravityview_log_debug', 'search-field-link.php - No choices for field' );
18 18
 	return;
19 19
 }
20 20
 
21
-$links_label = empty( $search_field['label'] ) ? __( 'Show only:', 'gravityview' ) : $search_field['label'];
21
+$links_label = empty( $search_field[ 'label' ] ) ? __( 'Show only:', 'gravityview' ) : $search_field[ 'label' ];
22 22
 
23 23
 /**
24 24
  * @filter `gravityview/extension/search/links_label` Change the label for the "Link" search bar input type
@@ -41,24 +41,24 @@  discard block
 block discarded – undo
41 41
 
42 42
         <?php
43 43
 
44
-        $search_value = rgget( $search_field['name'] );
44
+        $search_value = rgget( $search_field[ 'name' ] );
45 45
 
46
-        foreach ( $search_field['choices'] as $k => $choice ) {
46
+        foreach ( $search_field[ 'choices' ] as $k => $choice ) {
47 47
 
48 48
             if ( 0 != $k ) {
49 49
                 echo esc_html( $links_sep );
50 50
             }
51 51
 
52
-            $active = ( '' !== $search_value && in_array( $search_value, array( $choice['text'], $choice['value'] ) ) ) ? ' class="active"' : false;
52
+            $active = ( '' !== $search_value && in_array( $search_value, array( $choice[ 'text' ], $choice[ 'value' ] ) ) ) ? ' class="active"' : false;
53 53
 
54 54
             if ( $active ) {
55
-                $link = remove_query_arg( array( 'pagenum', $search_field['name'] ), $base_url );
55
+                $link = remove_query_arg( array( 'pagenum', $search_field[ 'name' ] ), $base_url );
56 56
             } else {
57
-                $link = add_query_arg( array( $search_field['name'] => urlencode( $choice['value'] ) ), remove_query_arg( array('pagenum'), $base_url ) );
57
+                $link = add_query_arg( array( $search_field[ 'name' ] => urlencode( $choice[ 'value' ] ) ), remove_query_arg( array( 'pagenum' ), $base_url ) );
58 58
             }
59 59
             ?>
60 60
 
61
-			<a href="<?php echo esc_url_raw( $link ); ?>" <?php echo $active; ?>><?php echo esc_html( $choice['text'] ); ?></a>
61
+			<a href="<?php echo esc_url_raw( $link ); ?>" <?php echo $active; ?>><?php echo esc_html( $choice[ 'text' ] ); ?></a>
62 62
 
63 63
 		<?php } ?>
64 64
 	</p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-single_checkbox.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 ?>
13 13
 
14 14
 <div class="gv-search-box gv-search-field-single_checkbox">
15
-	<label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" class="gv-check-radio">
16
-		<input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" <?php checked( '1', $search_field['value'], true ); ?>>
17
-			<?php if( ! gv_empty( $search_field['label'], false ) ) { echo esc_html(  $search_field['label'] ); } ?>
15
+	<label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" class="gv-check-radio">
16
+		<input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" <?php checked( '1', $search_field[ 'value' ], true ); ?>>
17
+			<?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { echo esc_html( $search_field[ 'label' ] ); } ?>
18 18
 	</label>
19 19
 </div>
20 20
\ No newline at end of file
Please login to merge, or discard this patch.